How to translate your site

All my themes come translation-ready: all the languages language files (.pot, .po.mo) are packaged with the theme.

You may want to translate your site because you want to:

  • simply translate everything (backend, buttons, options) into your native language, or
  • offer several versions of your website in different languages (everything included your content is available in different languages) (third party plugin required)

Translate the Theme

  1. Install Poedit. You need a special tool to open the language file. There are several translation tools out there, Poedit is the one I use. It’s basic but simple and FREE. You can download Poedit here.
  2. Open Poedit and click on Create new translation (or alternatively go to File > New catalog from POT/PO file) and select the POT in your theme’s languages folder. You could click on Translate WordPress theme but this function is only available in the pro version.
  3. A box will appear, fill it with the name of the project and the language you want to translate. Hit OK
  4. Then name your translation file. You absolutely need to follow this naming convention if you want your translation to work languagecode_COUNTRYCODE. For example, if you’re translating in French for France, the file should be name fr_FR.po, and for a Italian translation for Italy would be it_IT.po. You can find the codes here. Finally save your file in the languages folder of your theme.
  5. Translate your file using Poedit: select a word or phrase, enter your translation and click “Update.” The translation will appear in the right column. Finally save your file. Poedit will automatically create both .po and .mo files in your theme’s languages folder.

Setup WordPress

  1. Upload both files to the “languages” folder in the theme’s directory.
  2. Locate the the wp-config.php file in the directory for your WordPress installation. Open the file in a text editor and find this line: define ('WPLANG');
    Change this line to include the translation you just uploaded to WordPress. For example:define ('WPLANG', 'it_IT');

You’re done!

Was this article helpful?