- Add a language
- Default language
- Deactivate a language
- Full name
- Language code
- Text direction
- Order of languages
Go in Languages > Languages.
We are going to walk through all the settings available to define the languages.
1. Add a language
Choose a language in the dropdown list. Polylang comes with a list of more than 90 predefined languages.
If your language is not available in the predefined list, you can create it yourself by filling the relevant fields. Start with the “Full name”. To choose the correct “Locale” and “Language code”, please refer to the sections 6. Locale and 7. Language code.
Our policy to include a language in the predefined list is in no way linked to the number of speakers. We add a new language either when WordPress has a language pack available (meaning that WordPress is 100% translated in that language) or when Polylang itself is 100% translated in that language. You can yourself contribute to translate Polylang in your language.
2. Default language
Once Polylang has been activated, the first action is to create at least a language which automatically becomes your default language. The default language is identified by a star in the languages list table.
You can change the default language by clicking on the star appearing when hovering the default language column. If you previously assigned the default language to your existing content, the language of this content is not modified.
It is possible to delete the default language. In that case, Polylang will arbitrarily choose a new default language.
3. Deactivate a language
This option is available only in Polylang Pro. You can deactivate a language by clicking on the “Deactivate” link. This language is still visible on the admin side.
On frontend, a deactivated language is not visible to subscribers and anonymous visitors. It is still visible to logged-in users who have the edit_posts capability, i.e. administrators, editors, authors and contributors.
You can’t deactivate the default language. If you want to deactivate it, then you must choose another language as default.
4. Full name
You can change the name of your language, i.e how it is displayed on both frontend and admin sides. For example you can replace English by EN. Edit the language in the language table then modify the full name.
It is the code used by WordPress for each language. You can modify it while creating your language. You must use a correct WordPress Locale. For example, for your Spanish language, es_ES and es_AR are both valid choices.
Note: Although it is possible to edit the locale after the language has been created, it is not recommended. Indeed, if you replace a locale by another one, it is very important to manually replace all your corresponding language files for WordPress, your theme and all your plugins, otherwise these translations will not work. For example: es_ES.mo and es_ES.po are replaced by es_AR.mo and es_AR.po
Go on https://translate.wordpress.org/ to find all existing WordPress Locales. This website is also the place where to find WordPress translations when Polylang does no succeed to install them itself (generally meaning that corresponding translation is not complete).
6. Language code
The language code is automatically prefilled when you add a language thanks to the predefined list. Polylang uses the 2-characters ISO 639-1 language code. This code is used to build the URL. For the browser language detection to correctly work, it is best to keep the appropriate ISO 639-1 language code.
Since this code must be unique, you will need for some cases to modify it while creating your languages. Let’s suppose that you want to have three Chinese languages zh_CN, zh_HK and zh_TW which all share the same ISO 639-1 language code ‘zh’. You can replace the ‘zh’ language code in this way: zh-hk for zh_HK, zh-cn for zh_CN, and zh-tw for zh_TW.
Note: Although it is possible to edit the language code after the language has been created, it is not recommended to change it for sites with a big amount of content.
7. Text direction
This setting is used by Polylang to inform the theme that it has to load the LTR or RTL stylesheet.
How to know if a theme is RTL ready? The theme must include a rtl.css file. If it is not the case, either you have the possibility to ask to the theme author to do the work or you will have to do it yourself. You can refer to the codex.
Of course, all the default WordPress themes are ready for RTL scripts.
This option gives you the possibility to choose your language flag among all the country flags. They will be displayed on both frontend and admin sides.
9. Order of languages
This option allows you to choose the order in which the languages will be displayed in the language switcher.