Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The right way to translate a WordPress plugin depends on where it is distributed. For a plugin in the WordPress.org directory, contribute through its project at translate.wordpress.org; WordPress can distribute approved translations as language packs. For a private or other non-directory plugin, translate its POT template into a locale-specific PO file, compile that as an MO file, and install the files where the plugin can load them.

The key details are the plugin’s exact text domain, the target locale, and whether the plugin also has JavaScript strings. Follow the steps below to choose the route and check that the translation appears across the plugin.

Choose the translation route

Detail WordPress.org plugin Private or non-directory plugin
Where to translate The plugin project’s translation sets at translate.wordpress.org, after selecting a locale. [c001] Translate the plugin’s POT file, or ask its maintainer to generate one with WordPress internationalization tooling. [c002]
Who manages translations Translators contribute through the project’s collaborative translation workflow. [c001] You or the plugin maintainer manage the PO and compiled MO files. [c002]
How translations reach sites WordPress.org language packs are the normal distribution path. [c001][c002] Install the files in the plugin’s languages directory or in wp-content/languages/plugins, as appropriate. [c004][c007]
JavaScript strings The plugin must use WordPress JavaScript i18n functions and register translations for the relevant script handle. [c003] The same JavaScript setup is needed; a PO/MO translation alone does not make unwrapped JavaScript strings translatable. [c003]

Before you begin, identify the plugin and locale

Record the plugin slug, its text domain, and the locale you want to use. A locale may identify a language alone or a language and country variant. For a WordPress.org plugin, the text domain must match the plugin slug and use lowercase letters and dashes. If the domain does not match, WordPress may not associate the translation with the plugin. [c001]

Translate a WordPress.org plugin

  1. Open the plugin project at translate.wordpress.org. Select the locale you want and open the project’s translation sets. [c001]
  2. Translate the strings in the project. Preserve placeholders and plural forms rather than changing the format a string expects. [c002][c004]
  3. Check whether the translated interface appears on your site. WordPress.org language packs are the normal way directory-plugin translations are delivered. If a string remains in English, check whether it has been translated and whether the plugin loads that string through WordPress’s internationalization functions. [c001][c002]

Translate a private or non-directory plugin with PO and MO files

1. Get the POT template

A POT file is a template of the plugin’s translatable source strings. If the maintainer provides one, use that. If not, ask the maintainer to generate it with WordPress internationalization tooling. The template supplies the source strings; it is not itself the finished translation. [c002]

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

2. Translate the PO file

Create a PO file for the target locale from the POT template. A PO file contains source references and msgid entries; put each translation in its corresponding msgstr. Poedit is one documented editor option, and a plain text editor can also be used. Keep placeholders intact and translate plural forms in the entries provided for them. [c004]

3. Compile the MO file and place the files

Compile the PO file into an MO file. The PO remains human-editable; the compiled MO is the file WordPress reads at runtime. Name the files using the plugin text domain and locale, for example my-plugin-de_DE.po and my-plugin-de_DE.mo. Put them in the plugin’s languages directory or in wp-content/languages/plugins, depending on how the plugin is distributed and maintained. [c004][c007]

Make sure JavaScript strings are translated too

PHP translation files do not automatically cover strings displayed by JavaScript. Plugin developers need to wrap user-visible JavaScript text in WordPress i18n functions and call wp_set_script_translations() for the script handle. WordPress can then load a matching translation from translate.wordpress.org when one exists. [c003]

If you are translating a plugin rather than maintaining its code, a JavaScript string that remains in English may need a code change from the plugin maintainer; adding another PO/MO entry will not translate a string the script does not expose through the supported i18n setup. [c003]

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Install and verify the translation

  1. Set the site language. Choose the desired language in WordPress settings, or use WP-CLI to install a plugin language pack with wp language plugin install <plugin> <language>. The command’s arguments are the plugin and language identifiers. [c006][c007]
  2. Check the plugin in context. Visit its admin screens, frontend components, error messages, emails, and block-editor interface where relevant. Look for untranslated strings, incorrect plural forms, broken placeholders, and dates that do not fit the locale.
  3. Check strings assembled or displayed by JavaScript. A translation that works in PHP but not in a block or other script-driven interface may need the JavaScript i18n setup described above. [c003]
  4. Confirm the file and domain match. For a local translation, check the locale in the filename, the plugin text domain, and that the files are in a location the plugin can load. [c001][c004][c007]
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Review translations safely

Translated text is displayed in the application, so treat contributions as untrusted until reviewed. Escape output with the appropriate WordPress escaping function. Do not put raw URLs in translatable strings: use placeholders for variable values instead, so a translator cannot replace a trusted link with a different destination. [c005]

Rank #4

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.