A Developer’s Guide To Translating WordPress.org Plugins

This is a quick reference guide for WordPress plugin developers who host their plugin in the WordPress.org repository.

While elaborate documentation is available for each step of the process, I found it fragmented and confusing. This guide will be a snapshot of the process with links to further reading as necessary.

Step 1: Make sure your strings are translatable.

Enclose all translatable strings with WordPress translate functions: __() or _e().

_e() is the same as __(), but instead of returning the string, it echo‘s it. Use __() within printf or sprintf to include variables.

__( string $text, string $domain = 'default' )

The first parameter of the function will be the string to translate and the second parameter will be the text domain.

There are few more functions and use cases, refer this guide for all the info.

Which brings us to the next step, your choice of text domain.

Step 2: Make sure your text domain matches your plugin slug in the WordPress.org repository.

If your plugin url in the repository is: https://wordpress.org/plugins/my-plugin, then your text domain must be my-plugin.

For plugins hosted on WordPress.org, it’s no longer required to add Text Domain and Domain Path in the plugin header. Loading included language files (example) using load_plugin_textdomain is also no longer required.

Now your plugin is ready for translation. Commit the changes (if any) to WordPress.org repository.

Step 3: Add translations on translate.wordpress.org

Once your translation ready plugin is in the repository, you can add your translations by visiting https://translate.wordpress.org/projects/wp-plugins/my-plugin (example).

You could add them yourselves, find volunteers to contribute, or hire professionals to translate your plugin for you.

Strings Waiting For Approval On Translate.wordpress.org
Strings waiting for approval on translate.wordpress.org

The translations will not be available immediately, but will have a Waiting status until they are approved by someone who can. You can see this in the screenshot above.

Step 4: Add a Project Translation Editor to get your translations approved.

A Project Translation Editor or PTE is someone who is approved by the Polyglots team with the authority to approve translated strings.

  • You will need a PTE for each language.
  • PTE request can be made by the plugin author, or by a translator themselves.

To make a PTE request (example) as a plugin developer, follow the guidelines here: Plugin/Theme Author Translation Review/PTE Request.

Note that assigning a PTE is not mandatory to get translations approved, you could simply request a translation review. However, having a PTE will make the process much faster in the future, especially if the PTE is someone in your team or someone you have a direct relationship with.

The locale code required to make the PTE request is available here.

If you have personal contact with the translator, then you may request them to leave a comment to the post stating that they are willing to be the PTE for the project (example). This could speed up the process a tiny bit.

What happens next?

From this point on, there isn’t anything you need to do.

  • The polyglots team will process your request in due time. Remember, this is a volunteer operation, so do not expect immediate response. Although from experience, some volunteers are very proactive and swift. Just don’t expect it all the time. (Wait at least 3+ weeks before requesting a follow up on the request comments or on #polyglots Slack channel.)
  • Once 90% of the strings are translated, a language pack will be created by the repository.
  • These language packs will be listed on the right sidebar of your plugin page. Refer screenshot below.
Language Packs Listed On Plugin Page On WordPress.org_
language packs listed on WordPress.org
  • Then when a website has one of the translated languages set as the Site Language (under General Settings), as below…
Site Language Setting In WordPress General Settings
Site Language setting in Settings > General of WordPress Dashboard.
  • … the corresponding language pack will be downloaded next time any plugin, theme, or WordPress itself is updated.
Languge Pack Downloaded During A Plugin Update
Language pack for all plugins downloaded during a plugin update.

That’s pretty much all there is. Leave a comment if you are in doubt and I will try to answer. Also refer Internationalization Security doc for some tips and best practices.

If you found this helpful, please give a shoutout on your social channels. Thank you.

Hello, I am Arun Basil Lal. Thank you for reading!

I am a WordPress product developer and creator of Image Attributes Pro. I am passionate about solving problems and travelling the world.

Divi WordPress Theme - My Review

Divi WordPress Theme
Divi is a WordPress theme that web designers do not want you to know. It comes with a drag-and-drop theme builder. You can build beautiful looking unique websites without touching a line of code. Just choose from one of the many pre-made layouts, or pick elements and arrange them any way you like.

Divi is every WordPress developer's wet dream. Surprise your clients with neat responsive websites and have fun building them.

Divi comes from Elegant Themes. If you enjoy building websites, you *need* an Elegant Themes membership. 87 beautiful themes and 5 plugins for the cost of less than a candy-bar each!

Note: I am an avid user of Divi myself and this is a honest review. I wouldn't recommend something that I do not personally find amazing.

Leave a Reply

Your email address will not be published. Required fields are marked *