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

State of WordPress Internationalization in 2019

State of WordPress Internationalization in 2019

Over 52% of all WordPress installs are using a locale which is not American English. In this talk we’ll check how this is made possible. We’ll also learn more about tools and helpers that enables easy localisation of WordPress plugins and themes, whether they are public or private.

The new block editor (Gutenberg), not only changed our editing flow but also finally improved the way how internationalization is handled in JavaScript. Not sure how? Join this talk to prepare yourself for WordPress internationalization in 2019.

Dominik Schilling

March 08, 2019
Tweet

More Decks by Dominik Schilling

Other Decks in Programming

Transcript

  1. GlotPress • Lets you set up your own collaborative, web-based

    software translation tool • Previously powered by the deprecated BackPress library • Since January 18, 2016 a WordPress Plugin • https://wordpress.org/plugins/glotpress/ • Developed on GitHub: https://github.com/GlotPress/GlotPress-WP • > 35 Contributors, always looking for more
  2. Import of POT files • Importer runs on a cron

    job every hour • Wrapper for GlotPress’ default CLI importer • Slack notification in #polyglots channel
  3. .po - Portable Object # Translation of WordPress - 4.7.x

    in Spanish (Spain) # This file is distributed under the same license as the WordPress - 4.7.x package. msgid "" msgstr "" "PO-Revision-Date: 2017-03-15 12:53:17+0000\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" "X-Generator: GlotPress/2.4.0-alpha\n" "Language: es\n" "Project-Id-Version: WordPress - 4.7.x\n" #: wp-includes/admin-bar.php:354 wp-includes/admin-bar.php:449 #: wp-includes/admin-bar.php:516 wp-includes/deprecated.php:2792 #: wp-includes/deprecated.php:2794 msgid "Dashboard" msgstr "Escritorio"
  4. .mo - Machine Object de12 0495 0000 0000 0200 0000

    1c00 0000 2c00 0000 0500 0000 3c00 0000 0000 0000 5000 0000 0900 0000 5100 0000 4001 0000 5b00 0000 1000 0000 9c01 0000 0100 0000 0000 0000 0000 0000 0000 0000 0200 0000 0044 6173 6862 6f61 7264 0050 4f2d 5265 7669 7369 6f6e 2d44 6174 653a 2032 3031 362d 3039 2d32 3120 3130 3a31 393a 3130 2b30 3030 300a 4d49 4d45 2d56 6572 7369 6f6e 3a20 312e 300a 436f 6e74 656e 742d 5479 7065 3a20 7465 7874 2f70 6c61 696e 3b20 6368 6172 7365 743d 5554 462d 380a 436f 6e74 656e 742d 5472 616e 7366 6572 2d45 6e63 6f64 696e 673a 2038 6269 740a 506c 7572 616c 2d46 6f72 6d73 3a20 6e70 6c75 7261 6c73 3d36 3b20 706c 7572 616c 3d6e 3d3d 3020 3f20 3020 3a20 6e3d 3d31 203f 2031 203a 206e 3d3d 3220 3f20 3220 3a20 6e25 3130 303e 3d33 2026 2620 6e25 3130 303c 3d31 3020 3f20 3320 3a20 6e25 3130 303e 3d31 3120 2626 206e 2531 3030 3c3d 3939 203f 2034 203a 2035 3b0a 582d 4765 6e65 7261 746f 723a 2047 6c6f 7450 7265 7373 2f32 2e31 2e30 2d61 6c70 6861 0a50 726f 6a65 6374 2d49 642d 5665 7273 696f 6e3a 2034 2e36 2e78 0a00 d8a7 d984 d8b1 d8a6 d98a d8b3 d98a d8a9 00
  5. WordPress ❤ Language Packs • Translations are stored in wp-content/languages

    • Translations are auto-updated • Translations are installed on-the-fly when switching your site language • Translations are installed asynchronously during other updates • One more reason why auto-updates should not be disabled (and why you should too)
  6. import { __ } from '@wordpress/i18n'; __( 'Editor tips' )

    // wp.i18n.__( 'Editor tips' ) packages/nux/src/components/dot-tip/index.js wp.i18n
  7. Language Packs fi.mo fi.po admin-fi.mo admin-fi.po admin-network-fi.mo admin-network-fi.po continents-cities-fi.mo continents-cities-fi.po


    fi-f8f49d9fc4a9cf7d78ec99285417bd9c.json fi-0ce75ad2f775d1cac9696967d484808c.json fi-1a0cd6a7128913b15c1a10dd68951869.json fi-1bba9045bb07c89671c88a3f328548e8.json fi-2c5d274ea625dd91556554ad82901529.json fi-7f13c36c641b114bf18cd0bcc9ecc7e0.json fi-28b3c3d595952907e08d98287077426c.json fi-68f2cec7514bf8563c723a4d675fcfe6.json fi-8860e58c20c6a2ab5876a0f07be43bd9.json fi-a25d1cc7bf7ca0b4e114f6bea64943f4.json fi-bf0f094965d3d4a95b47babcb35fc136.json
  8. .json - Jed 1.x { "translation-revision-date": "2019-02-18 08:14:14+0000", "domain": "messages",

    "locale_data": { "messages": { "": { "domain": "messages", "plural-forms": "nplurals=2; plural=n != 1;", "lang": "fi" }, "Editor tips": [ "Muokkainvinkkejä" ] } } }
  9. Requirements • The plugin/theme uses a proper text domain registration

    • Text domain must be the same as the plugin/theme slug • Special case for WordPress 4.6+
  10. Reminder # WordPress < 4.6 my-plugin.php * Text Domain: my-plugin

    * Domain Path: /languages load_plugin_textdomain( 'my-plugin', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' ); # WordPress => 4.6 readme.txt: Requires at least: 4.6
  11. Requirements • The plugin/theme uses a proper text domain registration

    • Text domain must be the same as the plugin/theme slug • Exception for WordPress 4.6+ • The plugin/theme is hosted in the official WordPress directory • Nothing more. • Checkout our handbook for detailed information:
 https://make.wordpress.org/meta/handbook/documentation/translations/
  12. Good to know • Follow the #meta-language-packs channel on Slack

    • Language packs are updated 30 minutes after a change • Languages packs are generated if a project is 95% or more translated
  13. Good to know • Check the status by visiting the

    Language Packs page of your project on translate.wordpress.org
  14. Traduttore • Create your own translate.wordpress.org with automated language packs

    • All the tools are open-sourced • WordPress (https://wordpress.org/) • GlotPress (https://wordpress.org/plugins/glotpress/) • WP-CLI (https://wp-cli.org/) • Traduttore (https://github.com/wearerequired/traduttore) • Traduttore Registry (https://github.com/wearerequired/traduttore-registry)
  15. Traduttore • Once set up everything runs automatically • Direct

    integration with GitHub via webhooks • Imports new strings using the wp i18n make-pot command • Generates a ZIP archive on a change containing all the current translations • Integration into the default WordPress Translations API to download the ZIP archives
  16. 0 5.000.000 10.000.000 15.000.000 20.000.000 25.000.000 30.000.000 2010 2011 2012

    2013 2014 2015 2016 2017 2018 2019 723.562 782.079 987.623 1.290.687 1.692.593 21.393.138 10.157.097 3.788.374 5.959.809 1.076.057 Import of plugins and themes
  17. translate.wordpress.org • Improved Editor UI, Translation Memory, Copy from other

    languages, (Reject with) Feedback, and more… #yousawitfirst
  18. Language Packs • Faster updates for core, just like for

    plugins/themes • Reduce the number of complex packages • my_MM, far_IR, hu_HU, sr_RS, zh_CN • Make automatic release builds more … automatic • Move readme.html to translate.wordpress.org • No SVN
  19. Core • Performance Improvements • "Gutenberg phase 4 - an

    official way for WordPress to support multilingual sites"