Multilingual Websites using WordPress
Are you considering having a website built for your organisation? Do you need it to be available in both English and Maltese? Or English, French and Italian? Or any other combination of languages? Or are you a WordPress developer who needs to add this feature yourself? Read on.
WordPress, my preferred development platform, has come a long way since its early days. With the latest version, running multiple websites (on subdomains or even different domains) from a single WordPress install has become a breeze (translation: slightly less of a nightmare), and there are a myriad other features to keep developers like myself working quickly and efficiently, and keep clients happy with the design and functionality of their sites.
However, there’s still one thing that it doesn’t do “out of the box” – websites running in multiple languages (or “localisation” as we geeks like to call it).
Until recently, my experience of developing websites to run in multiple languages was restricted to a huge online payments web application written in Java and running in English, French, Italian, Spanish, Portuguese, Chinese and a few others. Java has its own “special” (i.e. wierd) way of doing many things, and handling multiple languages is one of these, so the skills I picked up on that project have not been broadly applicable.
However, one large project that I am currently working on has raised the multiple language issue. It’s a WordPress project, and the client’s request for multiple languages (English, French and Arabic) came part way through development, so it was time to hit the search engines and see how it could be done.
Guess what… use a plugin
Most additional or special functionality in WordPress is achieved through the use of one or more plugins, and it turned out that localisation is no exception. There are a number of plugins available which claim to make the job of localising a WordPress site (so that all content can be managed and viewed in any one of a set of chosen languages) easier, and each of them goes about it in a different way.
This article isn’t a plugin review, so I’ll save some space by saying that my research led me fairly quickly to one particular plugin, QTranslate. I haven’t used it for very long yet, but I can already tell that it is powerful and easy to use. If you’re building a WordPress site and need to add content in different languages, I’d like to save you some time by saying try QTranslate first. You probably won’t have to try a different plugin. It even downloads and enables the WordPress core language files for your chosen languages itself – a nice touch.
One QTranslate tip: make sure the visual editor is enabled for your admin user account, or you won’t see all the features when editing posts and pages. You can still select the HTML editor tab if that’s what you prefer.
It’s a start…
Installing QTranslate and then writing content in your chosen languages is not the whole story, however.
There are at least two other places in a WordPress installation (aside from the core files, which QTranslate takes care of) that contain content which is shown to the user – and therefore needs to be translated.
1. The Theme
A WordPress theme may or may not be “localisation-friendly”. Off the shelf themes are more likely to be ready to handle localisation if they are commercial (i.e. you have to pay for them), though a number of free third-party themes do have the required localisation code built in.
All my WordPress-based client projects use completely custom-built themes, and up until now I have not made those themes localisation-friendly, simply because I haven’t needed to. However, from now on I may do so, especially for Maltese clients, because building it in from the start is easier than adding it later.
If you have a WordPress-based site running in English, and you want to add another language, feel free to get in touch and I’ll give you a quote for carrying out this work for you.
And to return to the project that prompted this article, this is one task that is now on my “to do” list.
Note: if you’re going to offer a language like Arabic, don’t forget you’ll need to make your theme layout work from right to left as well as left to right!
2. Other Plugins
This is more interesting. A WordPress plugin can be in one of three states as regards localisation:
- Not localised – you could do it yourself (or pay someone to do it for you) but any future plugin updates would wipe out the localisation. Look for another plugin that fulfils the same function.
- Localised but not in the language(s) you want – this is more promising. You can create new language files yourself (or, again, pay someone to do it for you) and submit them to the plugin developer, who will normally add them to the next release.
- Localised in all the languages you want – perfect! Sorted.
And to return to my client project, this is also going to give me some work. One major feature of my client’s website is a searchable organisation database, which I built as a custom plugin. It’s the biggest WordPress plugin I have created so far, and includes two multi-function admin pages, new database tables, a widget and various shortcodes to insert content and forms into pages. So, another item on my “to do” list is to localise this plugin.
The project uses some other plugins, but luckily the ones that matter fall into categories 2 and 3 above.
This is something that doesn’t necessarily fit into either themes or plugins, or indeed core WordPress features, but it’s vital nonetheless. QTranslate offers a number of options for the URLs of translated pages (subfolder for each language, subdomain, etc) but you’ll need to make sure that once someone has selected a language, they stay with that language when they start clicking menu items.
And that will be the other item for my “to do” list. I haven’t yet worked out how to deal with this one (I’ve only done a couple of days
playing research, after all) but I’m confident that with QTranslate and possibly some theme tweaks, it will all come together in the end. In fact, if I want to get paid, it has to…
Tout est possible
So, the conclusion I have happily drawn is that making a WordPress-based site work in a number of languages, though not trivial, is certainly possible and practical.
If you’re a WordPress developer who hasn’t yet tackled this aspect of WordPress, take heart – it’s not as bad as you may think. I’m delighted with what my research has shown, because it means I can offer an additional service with confidence. A good starting point for learning more about this subject from a developer’s point of view is this article in the WordPress Codex.
And if this article has prompted you to think that I may be able to help you with a multi-lingual website, feel free to get in touch.