Workshop for introducing people to internationalization (I18N) and localization (L10N) in WordPress projects.
Accompanying slides can be found in slides.pdf.
- WordPress Plugin Developer Handbook
- The Importance of the Text Domain in WordPress I18N
- Introduction to I18N and L10N
- WordPress.org Translation Platform
- GlotPress
- Traduttore GlotPress Plugin
- I18N-ready Gutenberg Blocks
- Loading JavaScript Translations in WordPress 5.0
- PHP_CodeSniffer + WordPress Coding Standards
- WP-CLI
- Poedit
- Unicode Common Locale Data Repository (CLDR)
- W3C Internationalization Activity
Prerequisites:
- WP-CLI 2.0 or newer
In your WordPress site's directory, run the following command:
wp scaffold plugin my-plugin --skip-tests --plugin_name="My Plugin"
This adds the necessary code to create a new "book" post type to the "my-plugin" plugin:
wp scaffold post-type book --plugin=my-plugin
If you want books to have chapters you can add run the following command:
wp scaffold taxonomy chapter --post_types=book --plugin=my-plugin
The "my-plugin" folder includes the plugin from the WP-CLI example that adds a book post type with the chapter taxonomy to your WordPress site.
The "gutenberg-i18n-block" contains one of the examples from https://github.com/swissspidy/gutenberg-i18n-block that adds an internationalized Gutenberg block to your WordPress site.