POLYLANG – GETTING STARTED
Copyright 2015 - Christelle Drevon
This documentation refers to Polylang 1.7 and is licensed under
a Creative Commons Attribution-ShareAlike 4.0 International License.
REQUIREMENTS
You must use at least WordPress 3.8. As for WordPress itself, your server must run
PHP5.2.4 and MySQL 5.
If you tried other multilingual plugins, deactivate them before activating Polylang.
1 – CREATING LANGUAGES
After activating the plugin, go in Settings > Languages
❶ Choose a language. Polylang comes with a list of
more than 80 predefined languages. Click on the ‘add
new language’ button at the bottom of the screen.
❶
❷ If your language is not available in the
predefined list, you can create it yourself by filling the
relevant fields. The full name is the language name as
❷ it will be displayed.
❸ It is the code used by WordPress for each
language. It is very important to enter the exact
❸ WordPress locale for the language, otherwise the
theme translation will not work. For a full list of
existing WordPress locale, see:
http://wpcentral.io/internationalization/
❹ ❹ This code will be used to build the URL. It is best
to use the (lower case) 2-characters ISO 639-1
language code. For example: en, fr, de.
❺
❺ Polylang informs the theme it has to load the LTR
or RTL style. Note that not all themes are compatible
with both text directions.
❻ ❻ It is possible to choose the order in which the
languages will be displayed in the language switcher.
After adding the first language, 2 tabs are displayed.
❻ ❼
❻ Strings translation: Polylang allows translating user defined strings such as the
site title, the tagline, and the widget titles. Moreover themes and plugins can allow
you to translate their options here.
The translation of themes and or plugins are managed with the po/mo files that you
can handle with CodeStyling Localization plugin.
❼ Settings : the Polylang settings are displayed in a new tab.
2 – STRINGS TRANSLATION
Go in Settings > Languages and click on the Strings translation tab
❶ Thanks to these input fields you can translate the string in all defined languages.
❷ Here you can also choose a different date format and time format per language.
See: http://codex.wordpress.org/Formatting_Date_and_Time
3 – POLYLANG SETTINGS
Go in Settings > Languages and click on the Settings tab
❶
❷
❶ Default language: it will for example be used when someone visits your
homepage for the first time.
❷ Check this option to set up the default language for all existing posts, pages,
categories and tags. This option is removed once a language is assigned to all the
content.
❸
❹
❺
❻
❸ The URL is not modified: whether Polylang is activated or not, the URL stays the
same for posts, pages, categories and post tags. The URL for date and author archives
are modified to include the language code.
❹ This option is checked by default and you should keep it as is, unless you know
what you are doing. For a site in English and in French, your post URLs would look like:
• http://www.yoursite.com/en/my-post/
• http://www.yoursite.com/fr/mon-article/
❺❻ For advanced users, if you want to use subdomains (or a different domain per
language), all your subdomains (or domains) must point to the same directory (where
the WordPress index.php is present).
Note that, except with the first option which keeps as much URLs as possible, when
Polylang is de-activated, every URL loose the language information and thus all
external links are broken.
❼ This option allows you to hide the language information only for the default
language. In this case the monthly archives URL in the default language will look
like: http://www.yoursite.com/2015/03/
❽ Here you can choose to include the keyword « language » in your urls.
Keep /language/ in pretty permalinks: the monthly archives URL will look like:
• http://www.yoursite.com/language/en/2015/03/
Remove /language/ in pretty permalinks: the monthly archives URL will look like:
• http://www.yoursite.com/en/2015/03/
❾
❾ This option is checked by default: when checked, someone visiting your
homepage for the first time will be redirected to the homepage in the language
according to his browser preferences. If his browser preferences do not include any
language of your site, the default language will be used. Returning visitors will be
redirected to the homepage in their last browsed language.
❿ This option is checked by default: when checked the language column is
displayed in the Media list table which allows you to translate the title, the caption, the
alternative text and the description of the media.
⓫ Check these options and a modification will impact all translations. You can safely
keep all these options unchecked.
4 – CREATING MENUS
Go in Appearance > Menus
❹
❸
❶
❶ You have to create one menu per language and save them. Then the 'Manage
Locations' tab appears.
❷❸ On ‘Manage Locations’ tab or 'Menu Settings' assign your menus to the
relevant theme location.i.e : 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.
5 – CREATING WIDGETS
Go in Appearance > Widgets
Whatever the chosen options, the widget will display a language only if at least one
post or one page has been published in this language.
❶
❷
❸
❹
❺
❶ Here I requested the widget to display the language names and the flags.
❷ The widget will always send the visitor to the front page in the right language,
otherwise it will try to find the translated page (and link to the front page if none was
found).
❸ The widget will never display the current language.
❹❺ For all widgets you have now the possibility to choose to display it for all
languages (default) or only one language.
6 – TRANSLATING PAGE, POST, 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.
i.e : Let's create your Static Home Page in 4 languages in Pages > Add New >
❷
❸
❹
❶ To set the language, just choose it in the dropdown list.
❷ Choose, thanks to the autocomplete input field, an already existing post as
translation. The will turn in a .
❸ If you want to create a new translation, just click on the .
❹ The means that the translation is done. 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 Home Page are displayed in the Page list table :
❻
❼
❺ The means that this page is in this language. You can edit it by click on the .
❻ The means that the translation is done. You can edit it by click on the .
❼ If you want to create a new translation, just click on the..
If you are using a static front page, it must be translated in all languages. It is not
mandatory to translate other pages and posts. In the case of the creating Home
Page that will define as Static Pages: all your Home Pages must be translated. You
must have for all translations a instead a .
❽❾ 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. It has no
influence on the language of the user admin interface, which can be chosen in the
user profile.
❾
7 – DEFINE YOUR HOME PAGE AS A STATIC PAGE
Go in Settings > Readings
❶ Check this option.
❶
❷
❷ Then choose one of the page you have just created (the language doesn't
matter). This “Front page” option gives you the access to the option ❸ in Settings >
Languages > URL modifications :
❸
❹
The new Home page url is replace by:
• http://www.yoursite.com/en/
And this one does not exist anymore (it will send an Error 404):
• http://www.yoursite.com/en/home-in-english/