WordPress Internationalization Workflows

WordPress Internationalization Workflows

Soon after the release of WordPress 15 years ago, support for internationalization was added to the software. This meant that themes, plugins, and WordPress itself could be translated. This was a huge deal as WordPress is used all over the world, in countries where English is not the main language. WordPress was quickly translated into German, Japanese and many more languages.

Over the years, WordPress has steadily improved the way we have to work with internationalization. However, challenges still exist and there will always be new ones ahead. Projects like Gutenberg and ecosystems beyond WordPress.org force us to continuously iterate.

At WordCamp Tokyo 2018, I had the honor to talk about how to make use of the latest and greatest technology to make your WordPress plugin or theme fully internationalized. In this presentation I'm highlighting how you can leverage the powers of WordPress, GlotPress, and WP-CLI to improve the translation workflow in your WordPress projects.

5253258c79d25b02f51e0ac55e30cf69?s=128

Pascal Birchler

September 15, 2018
Tweet

Transcript

  1. None
  2. Pascal Birchler
 @swissspidy

  3. What You Will Learn Today

  4. WordPress + Internationalization

  5. Making a Plugin Translation-Ready

  6. Internationalization Workflow Optimization

  7. Terminology

  8. The process of creating a product in such a way

    that it can be easily adapted to specific local languages and cultures Internationalization (I18N)
  9. The process of adapting a product or service to a

    particular language, culture, and desired local “look-and-feel.” Localization (L10N)
  10. “Localization is like translation but with a cultural twist” Localization

  11. Defines the language, region, and cultural preferences. Locale

  12. WordPress I18N Efforts

  13. Making WordPress Global

  14. translate.wordpress.org

  15. None
  16. None
  17. translate.wordpress.org glotpress.blog poedit.net

  18. Language Packs

  19. User Locales

  20. None
  21. WordPress Plugin Internationalization Behind the Scenes

  22. WordPress Plugin Internationalization WordPress.org

  23. Writing a Plugin

  24. my-plugin/ my-plugin.php readme.txt

  25. <?php /** * Plugin Name: My Super Awesome Plugin *

    Plugin URI: https://wordpress.org/plugins/my-plugin/ * Description: My WordPress plugin that does nothing. * Version: 1.0.0 * Author: Pascal Birchler * Author URI: https://pascalbirchler.com */ __( 'Translate me', 'my-plugin' );
  26. === My Super Awesome Plugin === Contributors: swissspidy Requires at

    least: 4.6 Stable tag: 1.0.0 License: GPLv2 or later My WordPress plugin that does nothing.
  27. WordPress.org Plugin Directory

  28. wordpress.org/plugins/my-plugin

  29. translate.wordpress.org

  30. None
  31. wp-content/ languages/ my-plugin-de_DE.mo my-plugin-de_DE.po

  32. 1. Write Plugin 2. Submit to WordPres.org 3. Translate 4.

    Done!
  33. WordPress Plugin Internationalization Private Plugin

  34. Writing a Plugin

  35. String Extraction

  36. <?php /** * Plugin Name: My Super Awesome Plugin *

    Plugin URI: https://wordpress.org/plugins/my-plugin/ * Description: My WordPress plugin that does nothing. * Version: 1.0.0 * Author: Pascal Birchler * Author URI: https://pascalbirchler.com */ __( 'Translate me', 'my-plugin' );
  37. makepot grunt-wp-i18n Poedit

  38. my-plugin/ my-plugin.php languages/ my-plugin.pot

  39. Manual Translation

  40. my-plugin/ my-plugin.php languages/ my-plugin.pot my-plugin-de_DE.po my-plugin-de_DE.mo

  41. load_plugin_textdomain( 'my-plugin', false, __DIR__ . '/languages' )

  42. 1. Write Plugin 2. String Extraction 3. Translate 4. Load

    Translations 5. Done!
  43. Comparison

  44. WordPress.org Private Plugin - Very easy to use - Translation

    Platform - Just-in-time Translation Loading - Complicated process - String Extraction - No Translation Community - Manual Translation Loading
  45. Introducing Traduttore

  46. WordPress.org For Everyone

  47. translate.wordpress.org For Everyone

  48. How it Works

  49. WP-CLI

  50. # Create a POT file for the WordPress plugin in

    the current directory $ wp i18n make-pot . languages/my-plugin.pot
  51. github.com/wp-cli/i18n-command

  52. None
  53. Required\Traduttore_Registry\add_project( 'plugin', 'my-plugin', 'https://translate.example.com/api/translations/my-plugin/' );

  54. None
  55. WordPress.org & Traduttore Private Plugin - Very easy to use

    - Translation Platform - Just-in-time Translation Loading - Complicated process - String Extraction - No Translation Community - Manual Translation Loading
  56. required.com/en/blog/

  57. github.com/wearerequired/traduttore github.com/wearerequired/traduttore-registry

  58. What's Next

  59. Improving Traduttore

  60. Improving translate.wordpress.org

  61. JavaScript Internationalization

  62. Summary

  63. I18N Workflows in WordPress

  64. Public vs Private Projects

  65. Traduttore

  66. Future Changes

  67. Thank You.