• No products in the cart.




How to translate Wodpress themes and plugins

In the previous article I introduced you to the WordPress system, allowing to translate themes and plugins. Now it’s time to start working on it!

Let’s consider that your theme, or plugin provides the translation support, so you get at least the .pot file. To work on a theme or a plugin translation we will use the free Poedit tool.

If the .po file in our language is missing, then we need to create it from the .pot file, and add all the translations from the scratch.

Create .po file from .pot file

  1. Open Poedit, and go to the menu File -> New  from POT/PO file
  2. First thing it will ask you the .pot file from your theme, or plugin (languages folder).
  3. Next select the language and locale from the list.
    Poedit language selection
  4. Save the project (.po file) in the theme / plugin languages folder, naming in the same pattern as the other files in the folder, substituting the suffix to your own language code. The full translation file naming pattern is

[text domain]-[language code]_[LOCALE CODE].po

The text domain is explained in the Adding translation support to WordPress themes and plugins article, but you can simply copy the prefix (text domain) from other existing files in the languages directory.

Using the Mexican Spanish as an example, we will result with the name, like my_theme_name-sp_MX.po. The language code part (sp_MX) is automatically offered by Poedit.

If the .po file is also provided, then to translate the theme / plugin we only need to correct existing translation strings (if you wish), and add the absent ones.

Translate strings in .po file

  1. Open the .po file for your language in Poedit.
  2. Scrolling through the text strings in the main window, select important strings, and translate them in the Translation window.
  3. Save the .po file.

Poedit interface


Each time the .po file is being saved, the .mo file is being created / updated in the same folder.

After populating translation strings, the theme / plugin translation is ready. Now it is time to update the .mo file on your website, and to check the result online. There is no need to upload the .po file, neither the .pot file to the website. It is a good practice though to update the .po file as well in case you decide to use it a source for future corrections.

WordPress core also contains some strings for translation, such as:

  • complete translation of the administrator’s side (site backend)
  • standard system words, like months’ and days’ names, etc.

Translation for them is provided by WordPress itself. In case you need to change any system translations, you can locate the language files in the wp-content/languages folder, named

[language code]_[LOCALE CODE].po

All articles from this series

  1. Introduction to the structure of the WordPress translation.
  2. How to translate Wodpress themes and plugins.
  3. Theme’s original text strings customization.
  4. How to translate child themes.
  5. How to handle translations with plugins and theme updates.
  6. Adding a second language to a WordPress website.
  7. Adding translation support to WordPress themes and plugins.

As usually, I’ll be glad to answer your questions, or provide more clarification on the topic of this article:


    Leave a Reply

    © Isigma Photo. All rights reserved



    FACEBOOKGOOGLECreate an Account