WordPress: Internationalization
1h 22mIntermediate2023-05-25
Authors

Carrie Dils
Development, WordPress
Course details
The WordPress content management system powers over 40% of the web. And the WordPress user base and developer network isn't limited to English–WordPress is global software supporting a variety of languages, and its internationalization features allow developers to configure their code so they can be easily translated for any locale. In this course, Carrie Dils introduces the specific functions and tools WordPress developers can use to make their code translatable to any language. Join Carrie as she shows how to work with various translation functions in WordPress, how to make themes and plugins translatable, and even generate language files. Plus, if you know another language, find out how you can help the entire WordPress community by contributing to the WordPress translation project on GlotPress, an open-source platform used to translate WordPress.
Skills covered
WordPressContent Management Systems (CMS)Front-End Web DevelopmentWeb DevelopmentOpen SourceOne-Off
Concepts
Introduction
- WordPress internationalization
- What you need to know
- Project overview and exercise files
Introducing Internationalization
- What is internationalization
- Why internationalize code
- Internationalization vs. localization
Internationalization Concepts
- What is gettext
- Using text domains
- Translation functions
Working with Translation Functions in PHP
- Translating strings
- Translate HTML
- Use placeholders
- Argument swapping
- Working with plurals
- Adding context
Working with Translation Functions in JavaScript
- Including wp-i18n
- Using translation functions
- Loading translations
Make a Plugin Translation-Ready
- Introducing the project
- Best practices for internationalization
- Add text domain and set domain path
- Add translation functions to PHP
- Create and enqueue a script with wp18n
- Add translation functions to JavaScript
- Create a translation file
- Include an additional translation with your plugin
- Generate MO and JSON files
- Load translations
Advanced Concepts
- Automating text domains
- Language packs
- Internationalization Security
Contributing to Open Source
- Translating for WordPress with GlotPress
- Contributing to GlotPress
Conclusion
- What next