To support Multi-language websites we use a plugin called WP ML, here’s how to set it up and rock P4 in as many languages as you wish.
📚 Manage Planet 4 > Administration > Multi-Language P4 Site
Greenpeace Offices may operate in multi-language countries, and their websites must support multilingual content.
The initial requirement for your P4 deployment is to install the WPML plugin. Once done, follow the steps below to set up the language switcher in the navigation bar and determine the behaviour of the plugin.
WMPL Settings
🔎 Where can I find this ? Dashboard > Settings > WPML > Languages
Set up your P4 Languages
On the “Language switcher options” make sure to display all languages (see below), for the language commands to work properly. You can determine whether content that has no correspondent in all languages should redirect users to the home page (RECOMMENDED) or just not have the switcher.
🤔 Key Info : WPML provides the multi-lingual functionality to your P4 site. To customize the site commands (Search button, strings etc.), check translate your P4 site.
Set up the Language switcher
In order for the Language switcher to be visible you need to add it to the Navigation Bar Menu.
Once you click the relevant option you’ll get a pop-up, as shown below. Change the settings to meet the ones shown and click Save.
Frontend
After all the above changes you should be able to see the Language switcher on the website’s Navigation bar.
🤔 Key Info : This setup does not support a Primary / secondary language. All site languages are equally set up.
Language URL
WPML should by default use “/lang/”+slug URL constructions. All languages have a language identifier in front of the WP slug. This means that P4 multilingual URLs would look like this:
Why?
- The functionality we’re requesting conforms to the way that multilingual P3 sites like Canada, Belgium, India and Greenland currently function. Users are already familiar with this style of URL.
- Designating one site language as “primary” and the other as “secondary”, and reflecting this in URLs, is not going to be politically acceptable in some countries and generally, for minorities.
- URLs that pass parameters using the “?foo=bar” style don’t look as nice, e.g. in social media postings.
WPML can be configured to insert a language identifier in front of the slug instead of at the end, and to insert a language identifier at the beginning of URLs for content in the primary language just as for other languages.
The question is whether this WPML configuration will work with the P4 WP customizations. We can always configure WPML in our P4 deployment according to our tastes, but it would be better to know that this mode of operating is supported by the GPI team by default from the outset, and won’t break in later updates to the P4 core.
New content creation / translation
When you create content in one language, it is possible to translate in the second language of your P4 site.
EXAMPLE: I want to create a PR in the Canada staging site, in both English and French.
- I create my PR in English, include my title, body and image ( ?? )
- I Publish the post once done
- I hit “Translate this Document” in the Language Menu (don’t see it? Hit “Screen options” on top right of your screen in edit mode)
- I can decide whether to also duplicate the body image (“uploaded media”) to the translated version
- I hit “Duplicate”
- My French post is created ( ?? )
- I translate my title, text and body
- I hit Publish
- My Post is available in both languages
Connecting existing content to its translation equivalent
It’s possible to connect an independent page or post to its translation equivalent, if this was not done at creation phase.
Just hit the “connect with translations” command on the page control panel (right side), and type the name of the language variation. The system will also ask you which language should be the primary one. You need to save and refresh the page to save the configuration!
See .gif below.
Media Translation
The WPML Media Translation allows to choose images and other media for translated content. We will be able to provide replacement images for content in different languages and translate the meta texts of those images.
🔎 Where can I find this ? Dashboard > Settings > WPML > Media Translation