Category: Tutorials

How to Translate WordPress Theme

How to Translate WordPress Theme

This article explains how translators can go about localizing your WordPress theme to local languages.

Prerequisites
translation-ready, thats means theme support multi language but you translate manually.

Tools
Install Poedit tool. click here to download.
Or other tools, see Translating Tools.

Step by step
Running the Poedit, click the File word on the top of menu, then click New from POT/PO file. POT file usually place at folder: theme name/languages.

Then select a language of translation:

So you can translate manually.

Click save when you translated completely.

You must type a correct name and save, its important,see below.

The example is translated to Chinese, so file name is : zh_CN.po. You can see Poedit will create zh_CN.mo file automatically.

The naming of PO file

The naming of your PO file is very important and must match the desired locale. The naming convention is:

language_COUNTRY.po

Or, for non-standard encoded localizations:

language_COUNTRY.ENCODING.po

A list of language codes can be found here, and country codes can be found here. A full list of encoding names can also be found at IANA.

Update translation

You should click Catalog, then click Update from POT file when the theme update.

.pot/.po/.mo file Difference:
.pot: a basic translate template file.
.po: a readable translate file for user.
.mo: created automatically by Poedit, it is for computer to read. Your web server will use the MO file to display the translations.

Notice
WordPress can automatically match language after you have translated.

For instance: Your theme will display Chinese in Chinese language WordPress. But display English only if in English language WordPress.