Plugins

Make Your WordPress Site Multilingual With Polylang

polylang language switcher

So based on your analytical research, you find out that you have higher than usual traffic originating from Canada from users that specifically speak French (Who knew!). This is awesome but wait… Our site is in English only and we would wish to accommodate our friendly French speaking neighbors from the north. How do we do this?

We shall install the Polylang plugin as it can support numerous languages. So we will add French (Quebec, Canada) to our site.

From our WordPress dashboard hover over “Plugins” then “Add New“.

Add New plugin WordPress

Search for ‘Polylang‘ on the right then click on “Install Now“.

Install Polylanf plugin

Then “Activate“.

Activate Polylang plugin

The wizard will quickly help us add our languages to our site. We can add another language through the “Languages” menu later if need be.

Select the language you wish to add then click “+ Add new language“. Make sure to add the language your site is already in. In the case of our site, it’s English.

Polylang setup 1
polylang setup add languages

Click “Continue >

polylang autotranslate

Click “Continue >

Select the language that is not translated. In this case it is “Français – fr_CA” (This is for French Canada with the flag of the Canadian province of Quebec as it is primarily French speaking).

Polylang select language that requires translation

Continue >

Done! We will now add language switching capability to our menu.

We are done - Polylang eizard

Adding The Language Switcher To Our Menu.

Head back to the dashboard and hover over “Appearance” –> “Menus“.

Wordpress Edit menu

Under “Language switcher” in the left menu, add, “Languages” by making sure it’s checked beside it, then click “Add to Menu“.

Add items to menu WordPress

Beside “Menu Name” we will just add “EN” in front of “Top Menu” to distinguish it as our English menu and click “Save Menu“.

Rename WordprPress menu

Expand our newly added Languages menu item by clicking the arrow to view additional options. Select the options you would like. I have checked…

  • Displays as a dropdown
  • Displays language names
  • Displays flags
  • and check “Primary English” as this is the English menu.
  • Save Menu
Polylang language menu options

Let’s create the French menu by clicking the “create a new menu” link.

Name it “FR Top Menu” then click “Create Menu“.

Create new WordPress menu
  • Add the “Language switcher” (Add to Menu).
  • Under “Pages” section check your pages (Add to Menu).
  • Add the same options as you did in English but this time make sure “Primary Français” is checked.
  • Save Menu“.
Add language WordPress

Add Languages To your French menu.

Add Pages WordPress menu

Add your pages to your French menu.

Set language Polylang menu

“Primary Français”.

Click the “Manage Locations” tab and you should see the below. If you do not make sure the FR menu is associated with Français, and the EN is associated with English. Click “Save Changes“.

WordPress menu manage locations

Now let’s click the “Preview” button and see how our site looks. You will now see the language drop-down switcher as an item in our top menu.

WordPress menu language switcher

When we choose “Français”, you’ll notice an ‘/fr‘ at the end of our URL(I). This will identify our site as the French version. There will be no ‘/en’ as it is the primary language of our site. I will show you how to set your primary language later.

/fr
‘/fr’ is added to the end of our domain when we switch our site to french.

When we click ‘Français‘ we may see the below message.

Nothing Found

This is because we have no pages assigned to our French site so let’s do so.

Adding Translated Pages To A Specific Language

From our dashboard click on “Pages“.

You will now see 2 more columns added to our “Pages” page specified by a flag for each language. The check WordPress Checkmark mark under the Canadian flag signifies that it has been translated. The plus Click the plus sign to add translation WordPress mean we have to add a translation for that page. Let’s click the plus sign.

WordPress pages menu

In the right menu under “Document“, locate and expand the “Languages” section. Type the title of the page in its new language then click the pencil icon.

Add a new translated page Polylang

Note: It should be the same title in its translated language as it is in its primary language as they are associated. e.g: About (en) and its equivalent in french, (à propos).

You can now add your translated text. For the slug (URL), call this page https://mysite.com/fr/a-propos without an accent on the ‘a’.

Add content to WordPress page

Tip: If for some reason the page that does not need translating has a + sign next to it. Just visit that page and change the language from the “Language” section.

Switch language for page WordPress Polylang

Adding A New Language, Settings & Translations

To add a new language head over to the main dashboard and hover over “Languages,” then click “Languages“.

  • Choose a language” from the drop-down.
  • Click “Add new language” button below.

You will then need to repeat the steps to create translated pages for that new language as mentioned above.

You will notice a star in our English language column. This states that English is our primary language. To change to another language, just hover over another language’s row and click the star to make that language primary.

Add a new language Polylang WordPress

There are certain words and phrases that are constant on your site such as ‘Search‘. To translation these phrases, go to “Languages” and click “String Translations“. Here you can translate common phrases universally for each language.

Polylang string translations
String Translations
Make sure to click “Save Changes” at the end.

If you would like to automatically translate pages, Polylang offers another plugin to do so. It performs so many characters for free (100,000), then you would have to purchase the paid version to translate further. Just go to “Languages” and click “Lingotek” to activate.

Lingotek

And there you have it. You can now gain new audiences for your site by adding different languages.

References:

Please follow and like us:

Leave a Reply

Your email address will not be published. Required fields are marked *