Translating WordPress faster

As Galician GTE, I translate a lot of strings from English to Galician: WordPress core, WordPress.org infrastructure, plugins, themes, … As a bilingual speaker (Galician and Spanish languages), I realized I can translate faster if I use the Spanish translations as starting point, so I develop a CLI tool to translate all WordPress stuff from Spanish to Galician, using the open-source translations created by the Spanish community (thank you, folks). A few months later, I converted this CLI tool in a website, so you can use it without any installation. And, of course, I have released it as open source (AGPL).

The operation of this website is very simple: you select a project to translate, the source language you want to use to get the current translations and the destination language. The tool will look for the strings untranslated in the destination language, will replace the empty translations with the translations in the source language, and will generate a .po to start working. And it will use well-known translation pairs (currently only for Spanish (Spain) -> Galician).

You can use this tool with:

  •   A plugin.
  •   A theme.
  •   Patterns.
  •   The WordPress Development.
  •   The WordPress Continents & Cities.
  •   The WordPress Administration.
  •   The WordPress Network Administration.
  •   Meta – WordCamp.org.
  •   Meta – WordPress.org.
  •   Meta – WordPress Plugin Directory.
  •   Meta – WordPress Theme Directory.
  •   Meta – Pattern Directory.
  •   Meta – Forums.
  •   Meta – o2.
  •   Meta – Rosetta.
  •   Meta – Breathe.
  •   Meta – Browser Happy.
  •   Meta – Get involved.
  •   Meta – Learn WordPress.
  •   The Android app.
  •   The iOS app.

This tool can be very helpful for bilingual people who want to take advantage of the fact that one of the two languages they master has a much higher percentage of translations. For example, in the case of Galicia (Spain), its inhabitants are bilingual in Galician and Spanish, so that the Galician translation community can take advantage of the translation of the Spanish team (from Spain), using files pre-translated into Spanish of the translation chains that are missing in Galician, so the translation effort is much less, since in this case the translation is from Spanish to Galician and not from English to Galician. Similar cases are those of Catalan, Basque, Aragonese, Asturian, Balearic …

It is also designed for those cases in which there is a variation in the language, such as the case of Spanish, which has variations such as Spanish from Spain, Peru, Venezuela … in which the translations that have a lower percentage can use the work of the group that has done more work, as is the case of Spanish from Spain. This is also valid for other languages such as English, which has variations in Canada, UK, Australia …, German, with variations in Austria and Switzerland, Portuguese, with variations in Brazil and Angola, Arabic, with variations in Algeria and Morocco, … These are some of the current supported variations at translate.wordpress.org.

A translation example

I am going to explain how to use this tool to translate to Galician language 50 strings of the Duplicator plugin, using the current Spanish (Spain) translations.

  1. Select the translation type. Here I am going to translate a plugin. You can check the different elements available in the list above.
  2. Select if I am going to translate the “development” or the “stable” branch. By default, I always use the development branch, because the translations are automatically copied to the stable branch. This only applies to the plugins. Sometimes, a plugin only has one of these branches, so you need to take a look in the translation environment.
  3. The slug of the item I am going to translate. You can find it in the translation URL. E.g. https://translate.wordpress.org/locale/gl/default/wp-plugins/duplicator/ This only applies to plugins and themes.
  4. You can check this element if you want to translate the README text. The README text is showed in the plugin page, so if you want to get this text translated, you need to translate the README text. I start translating the plugin, and when I finished, sometimes I work with the README file.
  5. The source language, where the tool will get the translations. Be advised that sometimes the source language doesn’t have the strings translated, so you should take a look to the source translation. Tip: change the locale shortcode, and you will see the translation page for the source language. https://translate.wordpress.org/locale/es/default/wp-plugins/duplicator/?filters[status]=untranslated
  6. Sometimes the original language has variants, like formal and informal. Here you can select it. Usually you don’t need to do anything here.
  7. The destination language, where you want to translate the strings.
  8. The variants for the destination language. It is the same that the point 6.
  9. The number of strings you want to get in the .po file.
  10. The tool has an internal database with translation pairs, so some parts of the strings are automatically translated from the original to the destination language. Currently, the tool only has pairs for Spanish (Spain) -> Galician.
  11. Once you have completed all the options, you can click on the “Download .po” button to get the .po file.

Now I get a duplicator-gl.po file. I can open it with a translation tool like Poedit. I use Visual Studio Code with the gettext extension, that adds syntax highlight to po, pot and potx files.

Now I have to review and update the translation strings, which start with the msgid element.

Once I finish the review and update, I have to upload the .po file to the translation system. To do this, I access to the development branch. Be careful, because the plugins have two development branches: one for the plugin (the one I am translating) and the other for the README. In the other items (themes, apps,…), you only have one branch, so don’t look for both branches.

At the bottom of this page, you have an “Import Translations” link. Click on it.

Then you have to select the translated .po file, and you have to click on the “Import” button.

After a few seconds, I have “43 translations added” (because the Galician plugin only had 43 strings untranslated) and the plugin full translated.

2 comments

  1. Very nice solution! As I understand it can be very helpful for variants of languages as Argentinian, etc…

    Nice work!

  2. Thank you! Yes, for Spanish variants is very helpful. In fact, some Spanish variants are using this tool a lot.

Leave a comment

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.