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“.
Search for ‘Polylang‘ on the right then click on “Install Now“.
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.
Click “Continue >“
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).
Done! We will now add language switching capability to our menu.
Adding The Language Switcher To Our Menu.
Head back to the dashboard and hover over “Appearance” –> “Menus“.
Under “Language switcher” in the left menu, add, “Languages” by making sure it’s checked beside it, then click “Add to Menu“.
Beside “Menu Name” we will just add “EN” in front of “Top Menu” to distinguish it as our English menu and click “Save 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“
Let’s create the French menu by clicking the “create a new menu” link.
Name it “FR Top Menu” then click “Create 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 Languages To your French menu.
Add your pages to your French menu.
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“.
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.
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.
When we click ‘Français‘ we may see the below message.
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 mark under the Canadian flag signifies that it has been translated. The plus mean we have to add a translation for that page. Let’s click the plus sign.
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.
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’.
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.
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.
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.
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.
And there you have it. You can now gain new audiences for your site by adding different languages.