• Español |
  • Deutsch |
  • Русский |
  • Français |
  • Italiano |
  • Português |
  • Türkçe |

WPLANG

WordPress Multilingual

  • Blog
  • About
  • Toolbox
  • Contact
  • Start Here

How to translate a WordPress theme (or plugin): Poedit & Loco Translate

Posted: 22.06.15 | by Irena Domingo

In this article I show you how to translate your WordPress theme (or plugin): using Poedit or using another plugin. A fully localized and translated WordPress website requires translate contents (using WPML, Polylang, Multilingual Press, etc) and also text strings in php files (using Poedit or another plugins such as Loco Translate).

(Originally written on July 4, 2014. Updated on May 5, 2025)


INDEX

Introduction

1. Text strings: .POT, .PO and .MO files

1.1. Portable Object Template (POT)
1.2. Portable Object (PO) and Machine Object (MO)

2. How to translate a WordPress theme (or plugin)

2.1. Poedit
2.2. Loco Translate Plugin
2.3. Codestyling Localization Plugin


Introduction

If you want to make a WordPress site in one, two o more languages, there is a very important distinction to be made. A fully localized and translated WordPress website requires translate contents and text strings:

Translate contents (posts, pages, custom post types, etc)

Your content is stored in database tables. It´s not stored in files.  Translating content requires a solution that reads your posts from the database and stores your translations right there.

If you want to know how to translate your content, you can read this COMPLETE  GUIDE. You can use free plugins such as qTranslate or Polylang, or premium plugins such as WPML (standalone WordPress environment) or Multilingual Press Pro (WordPress Multisite).

Featured-Image-Article-Multilingual-Wordpress-Site

Translating text strings (PHP files) in themes and plugins

Themes and plugins contain text strings that are in files. Whenever you see something like:

<php _e( ‘Text’, ‘a-text-domain’ ) ?>

in a PHP file of a theme or plugin, then you need to translate them.

Text strings can appear in the backend and in the frontend

Examples of text strings in frontend:

  • “Search” (search button)
  • “Nothing found” (when you search something and nothing is found)
  • “Read more” (posts)
  • “Leave a comment” (text to encourage the user to leave a message)
  • “Comments are closed”
  • “Older comments”

Examples of text strings in backend:

  • “Top primary menu” (text in widgets area)
  • “Ready to publish your first post?” (text in WordPress dashboard)
  • “Number of posts to show:” (text in WordPress dashboard)
  • “Twenty Fourteen requires at least WordPress version 3.6. You are running version %s. Please upgrade and try again” (Twenty Fourteen theme).

Tools like Poedit (which you can use for free) or plugins such as Loco Translate or Codestyling Localization let you translate text strings in your WordPress files. Also premium translations tools like WPML let you translate text strings.

In this article I show you how to translate text strings: using Poedit, Loco Translate or Codestyling Localization Plugin. But first of all is important to know what are .POT, .PO and .MO files.

1. Text strings: .POT, .PO and .MO files

WordPress themes are localized using the GNU gettext framework. That’s the common way for WordPress itself and every theme or plugin. However, developers don’t always make translation ready themes, so when you use or buy a theme (or plugin) make sure to check it.

Many WordPress themes are multilingual ready. They must contain the correct files: .POT, .PO and .MO files.

1.1. Portable Object Template (POT)

The master theme (or plugin) translation file is a .POT file. Basically, the .POT file is a list of all the text lines used in the theme files in English language:

Pot file example

Developers use tools (like gettext) that scan the PHP source and produce a .POT file, which contains a list of all the original texts, which need translation.

The .POT file is put at your disposal by the plugin or theme developer and it’s used as a starting point to create new translations. WordPress doesn’t use it.

The .POT file can be found in the theme languages folder and in the plugin languages folder.

Examples:

  • Responsive WordPress theme: wp-content/themes/responsive/languages/responsive.pot
  • Contact Form 7 plugin: wp-content/plugins/contact-form-7/languages/contact-form-7.pot

Sometimes language folder is called lang (not language) and sometimes .POT files come with .PO and .MO files, and with a README.TXT file (instructions for translators):

Responsive theme pot files

 

 

Contact form 7 pot file

1.2. Portable Object (PO) and Machine Object (MO)

The .PO file includes the original texts and the translations in two columns. It´s a translation that someone else started (the author, a professional translator, a WordPress theme user, etc), and maybe completed. WordPress doesn’t use it.

Perhaps your theme or plugin is already translated. Example: if you see a file called es_ES.po, your theme is already translated into Spanish (es) of Spain (ES). You can check out here to find your language and country codes.

Responsive theme Po file

The .MO file includes the exact same contents as PO file. The two files differ in their format. While a PO file is easy for humans to read, MO files are compiled and are easy for computers to read. WordPress gets translations from .MO files.

The .MO file is automatically created by Poedit whenever you save a PO file. All you can do with these files is to upload or re-upload them whenever you create or update a .PO file.

2. How to translate a WordPress theme (or plugin)

2.1. Poedit

Poedit is a software (available for Windows, Mac and Linux) which you can use to translate the theme or plugin. It’s available for free on poedit.net. Free version comes with a builtin translation memory that remembers your past translations and uses them to make suggestions for similar texts.

Download Poedit

This program has a Pro version that enhances Poedit with additional features and benefits such as dedicated WordPress support, Word Count, etc. It costs $19.99.

Poedit Website

Here are the steps:

1. Open Poedit and select File > New Catalog from POT / PO file

2. Select the .POT file or the .PO file from the theme or plugin you wish to translate which (you can find the files in the wp-content/themes/your-theme/language/ folder).

3. A box will pop up asking for language of the translation. Select your language:

Poedit Select Language

4. Hit OK and Poedit will name automatically your file. If you select Spanish (Spain): es_ES.po

5. Save your file in your computer

6. Now you can start translating your theme or your plugin. The space at the top will display all the text ready to translate, and any completed translations will display to the right. The boxes underneath show the source text, your translation and any notes for translators. Translating is really easy – just select a word or phrase, enter your translation and click “Validate”.

Translating with Poedit

IMPORTANT:

      • You have to respect all special characters from the original text when translating (look at the screen capture)
      • It´s not necessary translate all text strings. Perhaps you don´t want to spend your time translating text strings of the admin theme.

7. When you’ve finished, save your file. Poedit will automatically create both .po and .mo files. You´ll have to upload both to your theme’s languages folder.

2.2. Loco Translate

Loco Translate is the best plugin to translate WordPress themes and plugins directly in your WordPress dashboard.

Loco Translate Plugin

The Loco Translate plugin is great for localizing WordPress themes and plugins.

Loco Translate RatingFeatures:

  • PO editor within WordPress admin
  • You can create and update language files directly in your plugin or theme
  • Extraction of translatable strings
  • MO file compilation
  • PO file backups
  • Built-in WordPress locale codes

Enhance Loco Translate with Automatic Translation

To further speed up the translation process, you can enhance Loco Translate with automatic translation using the TranslateX for Loco Translate plugin. This powerful add-on integrates with Loco Translate to provide seamless AI-powered translation capabilities, allowing you to automatically translate strings with just a few clicks. It’s especially useful when working with large sets of strings or when you need quick initial translations before manual refinement.

By combining Loco Translate with TranslateX, you can drastically reduce the time and effort needed to localize your WordPress themes and plugins.

Download Loco Translate

 

2.3. Codestyling Localization Plugin

(EDIT: this plugin has disappeared)

Another popular option is Codestyling Localization plugin. You can manage and edit all translation files (.PO/.MO) directly out of your WordPress dashboard without any need of an external editor (such as Poedit).

Codestyling Localization Plugin

Codestyling Localization Plugin RateCodestyling Localization plugin detects the gettext ready components like WordPress itself or any plugin or theme supporting gettext. This plugin is able to scan the related source files and can assists you using Microsoft Translator API or Google Translate API during translation.

After you have installed and activated the plugin, simply go to Tools > Localization and translate the theme or plugin from your WordPress admin following the plugin instructions.

Anyway, if you’re an experienced computer user, I recommend you to use Poedit to translate your themes or plugins, which is more complex but you don’t need to install another plugin.

 

 

 

 


This is the second article in the series on WordPress 100% Localized and Translated

Categories: Multilingual Websites


About the Author

Irena Domingo's avatar

Irena is the creator of the blog WPLANG (WordPress Multilingual) and a professional specialized in website localization. Irena now helps others to create a WordPress website in one language or create a multilingual WordPress website.

Comments

  1. Farhad says

    May 7, 2015 at 3:30 am

    Hi Irena,

    That is really nice explanation, May I know how to split the Theme’s .po file to backend strings and front-end? In this case we can save time to just translate front-end for website visitors.

    • Irena Domingo says

      May 7, 2015 at 8:16 am

      Hi Farhad,

      You can’t split .po files in WordPress. The only option is using a theme that has been developed with two .po files (one for the backend and other for the frontend)

  2. Usana says

    September 9, 2015 at 6:31 pm

    Thank you Irena… I found your post very usefull.

    • Irena Domingo says

      September 10, 2015 at 6:59 am

      Thank you

  3. Caue Rego says

    October 1, 2015 at 6:24 am

    Codestyling link is now broken. I think it’s discontinued, but of course I could be wrong.

    Do you happen to know if there’s any standard into translating a plugin AND contributing to them?

    Something like https://www.transifex.com , maybe. That one have no adoption in wordpress, as I see it, so maybe there’s some other similar stuff.

    • Irena Domingo says

      October 6, 2015 at 6:44 am

      Thanks. It seems that the plugin is no longer maintained.

      Have a look at this article about contributing to translate themes and plugins:Translation Management and Collaboration Platforms for WordPress Developers

  4. Nino says

    October 6, 2015 at 2:47 am

    Hi,

    Ok, when translation is made and mo&po files are generated, how to include them to be used by wordpress?

    FOr instance, I have spanish site and want to include english, where to define which site to show to visitor?

    thx

    • Irena Domingo says

      October 6, 2015 at 6:50 am

      Hi Nino, about your two questions:

      1. You have to upload .mo and .po files to your server in the language folder of your theme or plugin
      2. Settings > General > Site language

      • Miriaam says

        April 7, 2016 at 3:45 pm

        Hi. Irena. Great post. How to sett up the po. File to have 2 or more languages. I need to use the theme in 2 versions according to the language selected. How this can happen?

        • Irena Domingo says

          April 13, 2016 at 11:00 am

          Do you need your website in two languages? Then you have to use a multilingual plugin. Have a look at this article: Best translation plugins.

  5. Mohamed Fayeck says

    December 26, 2015 at 9:49 pm

    Hi, i need ur help please
    i am working on translating a theme ,
    actually am not planning to translate all theme 100%

    so what well happen if i leave some words without translation and saved the .mo file ?

    • Irena Domingo says

      December 27, 2015 at 2:45 pm

      In this case, contents without translations will be in English

  6. BigBankClub says

    February 7, 2016 at 7:06 am

    Great Article!! High fives!

    • Irena Domingo says

      February 7, 2016 at 2:43 pm

      Thanks!!!

  7. soheil says

    March 24, 2016 at 2:51 am

    Hi
    that’s perfect.
    I have a question .i translate bookly extension and upload it to my language folder but it didn’t work . i try with loco extension too,i have translated file in po and mo but when use the extension it’s english.
    i open the extension
    translate it
    save it
    and uploud it
    ok ,i think bookly should work!!!!
    is there any misunderstanding?

  8. Mindaugas says

    May 30, 2016 at 6:45 pm

    Hi, I am trying to translate with Loco Translate, looks good, but how to translate different words for numbers like

    1,21,31,41,51,61,71,81,91 comment(s) – komentaras
    2-9,22-29,32-39,42-49,52-59,(so on) comments – komentarai
    10-20,30,40,50,60,70,80,90,100 comments – komentarų

    Lithuanian language.

    Thank You for suggestion.

    • Irena Domingo says

      June 4, 2016 at 5:24 am

      Copy and paste numbers in the field of translation

  9. sabry suleiman says

    September 5, 2016 at 7:48 pm

    Great Article!! Thanks Irena

  10. Kenan says

    October 15, 2016 at 3:32 pm

    How can I find in a theme source code, the used .po or .mo files? For example; is the language file name de_DE.po or themename.po?

  11. mikael christiansen says

    October 21, 2016 at 4:13 pm

    Thanks for a good article, it is something that I can use

  12. lucy4g says

    October 30, 2016 at 1:23 am

    Hey Irena,
    This is very useful post you share
    as a WordPress user
    I am Thankful to You.

  13. Raza IVIOI-ISIN says

    February 10, 2017 at 12:59 am

    Very helpful and clear and simple article .. thank you dear

  14. as says

    March 3, 2017 at 4:03 am

    Not clear what is to do… i not have a PO and a POT file on my plugin. Never can start a new po file….
    I need a how to to make a starting po file from my plugin, with Poedit on windows

  15. Jessica Peltier says

    August 2, 2017 at 7:32 am

    Hi lrena,

    Amazing ! your post very helpful,I love this.

    trampoline review, Jumpsport Trampoline, https://www.youtube.com/watch?v=PyJKoQzoW0w

  16. Mohammad Khataan says

    December 29, 2017 at 12:38 am

    Is Loco plugin have option to make suggestions for similar texts like “Poedit”

Featured Posts

How To Make A Multilingual WordPress Site: Best Translation Plugins

How To Add Hreflang Tags in WordPress

How To Make Sitemaps In Multiple Languages With WordPress

WordPress Multisite: How to Make a Multilingual Website

How to translate a WordPress theme (or plugin): Poedit & Loco Translate

How To Submit Your Multilingual Website To Google, Bing, Yandex And Baidu

WordPress 100% In My Language

WordPress Multilingual, finally explained

Easy Social Share Buttons: A Plugin For Your Multilingual WordPress Site

WordPress 4.1: Install Language Packs From Dashboard

Twitter

Pages

  • About
  • Blog
  • Contact
  • Homepage
  • Sitemap
  • Tools I Use In My Multilingual WordPress Projects

This website is hosted by Cloudways, powered by WordPress (Genesis Framework and Caroline theme) and accelerated by KeyCDN

© 2014 - 2025 WPLANG: The Complete Guide to a Multilingual WordPress Website

Note that some articles of this blog contains affiliate links, so I make a few bucks if you use them. Thank you very much. Irena