WordPress is the most popular open source content management system in the world. Its users have spread around the world from English-speaking to non-English-speaking countries. That means not all websites powered by WordPress are created in English language only but many other languages than English.
As English is the universal language on the internet, almost all WordPress themes on the theme market are provided in English, ours are not an exception. So if you develop websites for those who might not speak English at all, translation-ready is now becoming one of the top must-have features for you to choose a WordPress theme.
Once you’ve got the translation ready theme, you should know how to translate it into the target language. In this post we will show you the way.
Finding a theme that enables translation
Before you buy a premium theme, make sure that it comes translation ready. Or you can choose any theme in our portfolio without wondering if it’s ready to translate or not because all of our WordPress themes are localized using the GNU gettext localization framework for translation. Once you’ve got your theme, it should include a language file with the file ending .POT inside the theme zip file.
Let’s have a quick rundown of three file types used in the framework before we’re about to translate the theme:
- POT – Portable Object Template. This is the file that contains all the text to be translated.
- PO – Portable Object: When translating the text in a POT file into the target language, both original texts and the translations are in this .PO file.
- MO – Machine Object. The PO and MO file have the same content but different formats. MO files are compiled and are easy for computers to read.
Translating your theme using Poedit
- Download a free translations editor from Poedit.net then install it.
- After you have installed Poedit, open it and go to File > New catalog from POT file and select the POT in your theme’s languages folder.
- Enter the language you want to translate and press “OK”.
- After that, your translation file will be automatically saved with a particular format. For example, if you want to translate English into Vietnamese, the file will be named vi_VN.po, or your file will be named es_AR.po if you want Spanish (Argentina) translation. Now save your file in the languages folder of your theme.
- Now you can start translating your theme. 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 you’ve selected to translate, your translation and any notes for translators.
- When you’ve finishing translating, simply save your file. Poedit will automatically create both .po and .mo files. After that, you have to upload the files to the theme’s language folder inside the host (wp-content/themes/[theme’sname]/languages)
Setting up your translated theme in WordPress
When you go to this step, meaning that you’re almost done because setting up in WordPress backend is very easy. After login to your WordPress admin panel, go to Settings you will see the page like the following image, scroll down the page to Site Language, and choose the language that you’ve translated before. Now both backend and frontend are displayed in the target language.