Upgrade to Pro — share decks privately, control downloads, hide ads and more …

WordPress Internationalization Workflows

WordPress Internationalization Workflows

I've presented an updated version of my WordPress I18N Workflows talk at WordCamp Johannesburg 2018.

In this presentation I'm explaining how internationalization and localization work in WordPress and how one can leverage the powers of WordPress, GlotPress, and WP-CLI to improve the translation workflow in their WordPress projects.

5253258c79d25b02f51e0ac55e30cf69?s=128

Pascal Birchler

October 26, 2018
Tweet

Transcript

  1. WordPress Internationalization Workflows WordCamp Johannesburg 2018

  2. Pascal Birchler
 @swissspidy

  3. What You Will Learn Today

  4. WordPress + Internationalization

  5. Making a Plugin Translation-Ready

  6. Internationalization Workflow Optimization

  7. Prerequisites

  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. Internationalization Done Right bit.ly/i18nDoneRight

  12. WordPress I18N Efforts

  13. Making WordPress Global

  14. translate.wordpress.org

  15. None
  16. None
  17. Language Packs

  18. WordPress Plugin Internationalization Behind the Scenes

  19. WordPress Plugin Internationalization WordPress.org

  20. Writing a Plugin

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

  22. <?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' );
  23. === 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.
  24. WordPress.org Plugin Directory

  25. wordpress.org/plugins/my-plugin

  26. translate.wordpress.org

  27. None
  28. wp-content/ languages/ my-plugin-de_DE.mo my-plugin-de_DE.po

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

    Done!
  30. WordPress Plugin Internationalization Private Plugin

  31. Writing a Plugin

  32. String Extraction

  33. <?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' );
  34. makepot grunt-wp-i18n Poedit

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

  36. Manual Translation

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

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

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

    Translations 5. Done!
  40. Comparison

  41. 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
  42. Introducing Traduttore

  43. WordPress.org For Everyone

  44. translate.wordpress.org For Everyone

  45. None
  46. None
  47. How it Works

  48. WP-CLI

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

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

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

  53. None
  54. 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
  55. required.com/en/blog/

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

  58. What's Next

  59. Improving Traduttore

  60. Improving translate.wordpress.org

  61. Gutenberg

  62. JavaScript Internationalization

  63. None
  64. Thank You.