3 – Strings translations

3 – Strings translations

Go to Languages > Strings translations. You must add at least one language to access this setting.
Polylang allows you to translate user defined strings such as the site title, the tagline, or the widget titles. Moreover themes and plugins can allow you to translate their options here.

The string column contains the source string. You can translate it in all your languages thanks to the input fields in the translations column. Don’t forget to click on save changes.

Advanced usage of strings translations
Translating slugs (Polylang Pro)

4 – Create menus

4 – Create menus

Go to Appearance > Menus

❶ You have to create one menu per language and save them.
❷ Under ‘Menu Settings’ assign your menus to the relevant theme location, for example ‘My English Menu’ to ‘Primary menu English’ and ‘My French Menu’ to ‘Primary menu Français’.
❸❹❺ You have the possibility to add a language switcher anywhere in a menu. If you don’t see the language switcher metabox, check that it is not disabled in the screen options.
Note that the language switcher will display a language only if at least one post or one page has been published in this language.
❻❼ Before adding your menu items (pages, categories…) to your menu, we recommend you to activate the admin language filter, available in the admin bar on top of the screen, with the same language as your menu. This way, you will be sure to add your content in the right language. Note that you must select the right item in the right language to get the right link.

5 – Widgets

5 – Widgets

Polylang language filter

Legacy widgets
Widgets block editor

Languages options

All languages
Choosing one language

Polylang language switcher

Language switcher with legacy widget
Language switcher in block editor

1. Polylang language filter
1.1 Legacy widgets
Legacy widgets are the ones that were available prior to WordPress 5.8 (Appearance tab => Widgets sub-tab). They still work in WP 5.8 and beyond and can be accessed in the legacy widget block. You have the possibility to choose to display them for all languages (default setting) or only one language.

1.2 Widgets block editor
Since WordPress 5.8 widgets are now managed in the widgets block editor (Appearance tab => Widgets sub-tab). With Polylang Pro the language selector is also available in the block embedded view. As for the legacy widgets you can choose to display them for all languages (default setting) or only one language.

2. Languages options
2.1 All languages
Choosing “All languages” in the language dropdown means, as the option suggests it, that this particular widget will be available regardless of the language that is displayed. With this option  you will have the possibility to translate the title in the Strings translations option.

2.2 Choosing one language
Choosing to display a widget for one language (selecting a language in the dropdown list) implies that this particular widget will only be visible on pages and posts available in this particular language. Once the language is selected a flag is displayed on the left of the dropdown list (replacing the language icon)  corresponding to the selected language.

3. Polylang language switcher
3.1 Language switcher with legacy widget
With Polylang you have the possibility to add our widget Language switcher (Appearance tab => Widgets sub-tab) by first adding a block “Legacy Widget” in which you then select the Polylang Language Switcher

3.2 Language switcher in block editor
With Polylang Pro comes a block allowing you to display a language switcher. Regardless of the chosen option(s), the block will only display a language if at least one post or one page has been published in this language. More about this block in The language switcher documentation.

6 – Translating pages, posts, categories and tags

6 – Translating pages, posts, categories and tags

It is very important to set the language for all existing posts, pages, categories and tags otherwise they won’t be displayed on frontend.
Usually, you will define the language when editing your page. This is done by accessing a plugin in the block editor. See the first screenshot showing the button to access it. In the classic editor, the languages metabox is directly accessible on the side of the screen. See the second screenshot.

Let’s create a page in 4 languages:
Go to Pages > Add New
❶ Choose the language in the dropdown list.
❷ You can choose, thanks to the autocomplete input field, an already existing page as translation. The  will then turn in a .
❸ You can create a new translation by clicking on the  icon.
❹ Clicking on the  icon allows you to edit the translation.
The operation for posts, custom post types, categories and tags is exactly the same.
Below is how your pages are displayed in the Pages list table:
 

❺ The flag icon means that this page is in this language. Clicking on it will edit the page.
❻ Clicking on a  icon allows you to add a new translation.
❼ The  icon means that a translation exists. Clicking on it allows you to edit the translation.
It is not mandatory to translate all the content.
❽ You can filter the content by language (posts, pages, media, categories, tags, comments, string translations). This choice is persistent (kept even when you log out) and also impacts the default language when creating a new content.

7 – Define your home page as a static page

7 – Define your home page as a static page

Go to Settings > Reading

It is mandatory to translate the static front page in all languages. If you choose a page not translated in all languages, you will get an error message and your choice will not be validated.
Choose one of the page you have just created (the language doesn’t matter). This “Front page” option gives you the access to a new option under Languages > Settings > URL modifications:

If you check this option, your Home page url will look like:
• http://www.yoursite.com/en/
And the other one below will not exist anymore (it will send an error 404):
• http://www.yoursite.com/en/home-in-english/

Managing the license keys

Managing the license keys

You receive your license key in your purchase receipt. Alternatively, it is also available in your Account > License keys tab.
If you skipped the setup wizard you need to register your license key by going in Languages > Settings > License keys module.

Enter the license key in the field as in the example shown below and then click on ‘Save changes’.

Now the license key is associated to your site. During one year, you will be able to receive updates in your WordPress dashboard for Polylang Pro and/or Polylang for WooCommerce (like it is done for wordpress.org plugins). You will need to renew your license to get updates after one year.
NB: If you purchased the Polylang Business Pack, you received 3 license keys, one for Polylang Pro, one for Polylang for WooCommerce and one for the Polylang Business Pack. You must enter the first two license keys in Polylang settings to receive the plugins updates. The third one will be used only to renew your license.

Theme internationalization and localization

Theme internationalization and localization

This step is very important otherwise your theme will not be translated when displaying posts or pages in a language different than your WordPress default language.
Check with the theme author that the theme is internationalized (meaning that it is ready for translation) and localized (meaning translated) to the languages you need. If it’s not the case, either you have the possibility to ask him to do the work (great!) or you will have to do it yourself. You can refer to the theme developer handbook.
Internationalization (I18n) means editing php files of your theme and requires limited programming competence. Localization (L10n) means only creating new .po and .mo files and requires only linguistic competence. You can use either poedit or a free plugin, Loco Translate.
Check that your theme includes the following line (or something similar) in the file header.php:
<html >
This line must be placed just after the DOCTYPE line and above the line. It is not mandatory but some browsers and robots use this line to detect your page language.

Configure the languages

Configure the languages

Add a language
Default language
Deactivate a language
Full name
Locale
Language code
Text direction
Flags
Order of languages
Locale fallback

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

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

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.
5. 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

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.

8. 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

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.

Delete a language

Delete a language

To delete a language, go in Languages > Languages. Click on the red delete link for the language that you want to delete. You will get a confirmation message, however your choice is definitive.

How your content is impacted?

❶  Before deleting the French language, both posts have a language and are translation of each other.
❷  After having deleted the French language, the French post (Post FR) is not removed but no more language is assigned to it. You also loose the link with the translations in other languages. The  posts without language are still available and visible on admin side, but they are not shown anymore on frontend side.

Pages, categories, tags, custom post types and custom taxonomies  are impacted in the same way. The navigation menus are not deleted either but no more language is assigned. Strings translations are definitively removed. The same for all users biographical information in that language.
Once a language is deleted, you will get a message above the languages list table to warn you that not all content has a language assigned (and thus that not all the content is visible on frontend). The link offers you the possibility to assign the default language to all the content without language.

Assign a language to an existing content

Assign a language to an existing content

Set the default language to the existing content
Edit the content to assign a language
Assign a language thanks to the Quick Edit
Assign a language thanks to the Bulk Action

Note: If you change the language of some content already translated in other languages, you will loose the link with the translations in other languages.
1. Set the default language to the existing content

The default language is indicated by the star icon in the languages list table. If there is some content (whatever it is posts, pages, media, categories…) without language assigned, a message appears above the languages list table. Click on the link “You can set them all to the default language” to assign the default language to all your existing content without language. A flag icon is now displayed in the list tables for the pages, posts, taxonomies, media in the default language column.

2. Edit the content to assign a language
Edit your content (post, page, category, or tag…) Then thanks to the Polylang’s language metabox,  choose the relevant language and save your changes.

3. Assign a language thanks to the Quick Edit
In the Quick Edit option you have the possibility to choose your language for a content.

4. Assign a language thanks to the Bulk Action.
The Bulk Action allows you to assign a language to several posts or pages at once.