Sites on the OpenLab

Polylang

Polylang allows you to create multilingual websites, increasing accessibility of your materials for a wider audience. It allows you to translate your content into multiple languages, add a language switcher to allow visitors to choose their preferred language, and customize the language display on your site. 

This plugin is intended for sites where a more accurate translation is desired. For automatic translation, we have the GTranslate plugin, which uses Google Translate, and creates an automatic translation of your site in multiple languages. 

Plugin activation and Initial Setup

1. Go to Dashboard > Plugins and activate Polylang.

2. After you activate the plugin, Polylang’s interactive setup will begin. In the first screen, you will select all the languages you are planning to use in your website. You can add or remove languages later, but we suggest that you choose them at this step.

3. Click the dropdown menu, select a language, and click + Add new language. After you do this, the language will appear on a list at the bottom of the setup screen. Repeat this step with all the languages you plan to use and when you are done, and click Continue. Important: You will also need to add the default language of your site here. For example, if the default is English, you will still need to add this language 

4. On the next page, click Allow Polylang to translate media, then click Continue.

IMPORTANT STEP: You are now asked to choose a language to be your default language. Any time you create a post, page, or other type of content without specifying the language, your site will automatically assign the default one. For most of the use cases, it is likely that the default language will be English. Select the default language and click Continue.

5. You are now done with the interactive setup. Click Return to the Dashboard on the bottom of the page.

6. IMPORTANT! There’s another step to do before translated posts appear correctly in the different language versions of the site, due to an occasional WordPress quirkiness with permalinks. Go to Dashboard, click Settings > Permalinks. Don’t change anything and click Save Changes.

Adding language switchers to the top menu

1. In the Dashboard, go to Appearance > Menus.

2. On “Select a menu to edit”, choose “Main Nav” and click Select.

3. Check the “Languages” box in the Language Switcher and click Add to Menu.

4. You will find “Languages” all the way down in the Menu options. Click and drag it to bring it to the position you want. We recommend putting it as the first option, so people who don’t understand the site language can immediately see it.

5. Now click the “Languages” item to change the settings. We suggest checking the following items: “Display as a dropdown”; “Display language names”; and “Display flags”.

6. Click Save Menu on the bottom of the page. Your website will now have language options in the Top menu. Hover your mouse of the Language name + flag to see the dropdown options.

Creating translated versions of posts and pages

1. To create a translated version of a post, go to Posts > All Posts (or, in the case of pages, Pages > All Pages).

2. There will be a new column with flags representing the language options. Notice that all posts will have the language flag of the default language you chose in setup. 

3. To create a version of another language, click the + symbol under the language you want to add, which will create a new post. (In the example below, the Mexican flag represents the Spanish language.)

4. In the new post, fill the title and the contents with the translated version of the post you want to translate. When you’re done, click Publish.

5. Your alternate post/page is now ready. If you want to test it out, go to the original post/page and click the language switcher in the menu. You should be directed to the new version you translated.