Blog

The Digital Agency for International Development

A truly multilingual site for Africa LEDS Partnership

By Martin Burchell on 11 May 2017

WordPress has good multilingual support through various third party plugins but generally they assume that users only want to view content in one language or another. If a user can read more than one language and not every post is translated, they may not be aware of the content that is available to them if they are not in the habit of switching languages.

When we developed a brand new website for the Africa LEDS Partnership, we were asked to make the site available in French and English. As their French speaking audience was also likely to understand English, we would make the English posts available on the French site where no French translation was available.

We evaluated a number of multilingual WordPress plugins and chose polylang due to its popularity, frequent updates and extendibility. In order for posts to be listed in multiple languages we created a small plugin multilingual-polylang. This plugin provides a function to get posts in all languages but where multiple translations of a post exist, to include only the one for the currently selected language. This function could then be used in our theme templates to loop through the list and display each post.

The plugin can be downloaded from the WordPress plugin repository and the source code can be downloaded from GitHub.