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.

 

 

Access WMPL Settings

As an Admin, go to Settings > WPML > Languages

wpml-settings

 

 


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.

wpml-options

  • 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.

wpml-nav

 

 


Frontend

After all the above changes you should be able to see the Language switcher on the website’s Navigation bar.

wpml-navbar

 


Language URL

  • KEY INFO >>  this setup does not support a Primary / secondary language. All site languages are equally set up.  

 

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?

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.

 


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.

Here’s how to duplicate one P4 content (in this case a Post) from one language to the other, you can also keep images!

 

The translated version of my Post. I can see at any time the original version on the right side

 

 


Links & Resources