Theme localization
WPML allows localizing themes in two ways:
- The traditional .mo files (good for when you already got that with the theme).
- Translate the theme’s texts directly from WPML
This is the theme localization menu, found in WPML->Theme localization.
Providing translation for the theme texts
Option 1: Translating the theme from within WPML
When WPML localization is selected (the 2nd option in the image above), WPML will scan the theme and find the texts that can be translated. It reports what it finds and let you enter translations, right from within WordPress.
Click on Scan the theme for strings and WPML will go through all the files in the active theme and get translatable texts from them (texts that are wrapped with gettext functions).
It shows how many strings were found in the theme and their translation status. To translate them, click on View strings that need translation. This will take you to the String translation page, where you can enter translation for each of the texts found in the theme.
* Don’t stop here, next you need to set the locale for each language.
Option 2: Using a .mo file for theme localization
Many WordPress themes already come with translations to different languages. When this is available, you can use the translation that’s already provided instead of translating yourself.
To use translation from a .mo file, choose the first option from the theme localization menu. The only thing that you need to specify is the text-domain for your theme.
When the theme was created, the texts were wrapped in gettext calls. Each call includes two arguments – the string that needs to be translated and a second argument called the text-domain. This second argument identifies all the texts in the theme as belonging to it. You need to enter this value in the text domain field, so that WPML can load the translation file and assign it to the theme.
Specifying the locales for different languages
A locale is a code which determines which language variant to use for different languages. In order for theme localization to work correctly, you need to tell WPML which locale value to use for different languages.
The following table lists locale values for popular languages:
| Language (links to the WordPress localization) | Locale | Country |
|---|---|---|
| German | de_DE | Germany |
| Spanish | es_ES | Spain |
| Dutch | nl | Netherlands |
| Danish | da_DK | Danish |
| French | fr_FR | France |
| Italian | it_IT | Italy |
| Brazilian Portuguese | pt_BR | Brazil |
| European Portuguese | pt_PT | Portugal |
| Russian | ru_RU | Russia |
| Traditional Chinese | zh_CN | China |
| Simplified Chinese | zh_HK | Hong Kong |
| Japanese | ja | Japan |
* There are many other .mo files available through the WordPress localization project.
To enable localization for your language, you need to do two things:
- Set the language locale file in the Locale file name column.
- Download the WordPress locale file and save it to wp-includes/languages. The download links are provided in the table above (click on the language name).




English
简体中文
Deutsch
日本語
Español
Thx for the plugin!!! It’s been really useful!!
I think you should have a link to this post. It makes much more sense about text domain and text wrapping. It took me some time to figure that out.
By the way, simplified Chinese is used in China, and traditional Chinese is used in Hong Kong and Taiwan. You got it another way round.
Yes, this sounds amazing…
just a quick question:
What is the concept for multiligual support of plugins?
Thanks
Markus
Right now, WPML doesn’t localize plugins (yet), so you still need to use the .mo files for that. We’re planning to add this soon, but I can’t give an exact date.
There’s no voice like “WPML->Theme localization” in the plugin menu
Click on ‘Advanced’ at the right-top of the WPML configuration page. Then, the menu will include this as well.
is there any way to shose a theme for a selected language? for exemple if defaut language > use the EN-theme if arabic then use the AR-theme ( where ( AR-theme is the name of the wordpress theme )?? any idea?