Configure the languages

  1. Add a language
  2. Default language
  3. Deactivate a language
  4. Full name
  5. Locale
  6. Language code
  7. Text direction
  8. Flags
  9. Order of languages
  10. Locale fallback

Go in Languages > Languages.
We are going to walk through all the settings available to define the languages.

languages-settings

1. Add a language

add-languages

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 5. Locale and 6. 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 almost 100% translated in that language).

2. Default language

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.

It is possible to assign the default language to all the existing content.

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

deactivate-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

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.

5. Locale

locale

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

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

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.

8. Flags

flags

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.

For frontend only, you can add custom flags.

9. Order of languages

order

This option allows you to choose the order in which the languages will be displayed in the language switcher.

10. Locale fallback

This option allows you to choose the locale to use if a plugin or theme translation is not available in the main locale. You can enter several locales separated by a comma as shown in the example above, this option is available only in Polylang Pro.