Most of the WordPress themes come with one and only language – English. This tutorial shows you how to translate any WordPress theme to your local language of choice.
What you’ll need
Before you begin this guide you’ll need the following:
- Poedit software installed on your computer. Poedit is available on OS X and Windows and can be downloaded from here.
- WordPress Theme files on your computer.
Step 1 — Opening Your Theme’s Default Language Template
Open Poedit and select Create new translation:
A new window will pop up, select WordPress theme you want to translate. A Theme’s default translation template is located in
THEMEXXX is the name of your theme and
YYY – default language of the theme (
twentysixteen/lang/en_EN.po in this example):
Next, from a dropdown menu select a language you want to translate your theme to:
You are ready to translate your theme now.
Step 2 — Translating Your Theme
Highlight any string you want to translate:
In the Translation section enter a desired translation of the source string:
Once you have translated your theme, save the file (
lt_LT in this example) in the same directory as the original template:
Step 3 — Changing Your WordPress Website Language
Upload the .po file you have saved in step 2 (
lt_LT.po in this example) and .mo file (
lt_LT.mo was generated automatically by Poedit) to the corresponding directory on your hosting account.
The directory should look similar to
THEMEXXX is the name of your WordPress theme. Refer to this tutorial on how to upload files to your account.
wp-config.php file (it is located in your WordPress installation) and add the following line:
define ('WPLANG', 'ZZZ');, where
ZZZ is the name of the file you have used to save your translation (
lt_LT in this example):
Your Theme will now appear translated:
Now you know how to translate your WordPress theme using Poedit translations editor. This skill is valuable if you want to adapt your website to your local language. The same translation principle applies to WordPress Plugins as well.