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.
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
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.
|
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.
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.
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
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.
The translate the media, Goto WPML >> Media Translation
Links & Resources
- WPML – Official Plugin portal