Create a WordPress multilingual site

Large international campaigns may need to set up multilingual websites, but creating a good site in multiple languages is harder than it looks. First because it may involve dozens of editors located in different countries, but most importantly because of the cultural differences between users from different countries. Design is not an universal language it needs to be adapted to the culture of the countrie/language.

Another problem is that most content management systems aren’t ready to properly help managing a multilingual siste. I’ve experimented with many different content management systems, and I’ve found WordPress to be the best choice for the job. This article is about how to configure WordPress for a multilingual site.

Wordpress MU logo

Why WordPress?

Because Worpress is the most popular CMS at the moment. It’s easy to find webbies that can create websites with it and many web writers already know how to use it, saving time and money on training.

There’s many books, tutorials and forums about WordPress, in many languages. More than in any other content management system.

Wordpress is also themable and extensible: there’s thousands of ready-to-use designs and plugins, some free and other relatively cheap. WordPress and some of it’s plugins and themes are completely free. Free as in freedom, not just in cost. This means it’s easy to adapt an existing theme or plugin, saving the time and money.

With WordPress in network mode you can use multiple languages and multiple themes (or variations of the same “parent” theme) on the same site.

How to set up a multi-language website

1 – Download and install WordPress

If you are creating an international site, probably English is the base language for translations. If that’s the case start by downloading WordPress in English and install it on your server.

2 – Activate multisite

By default each WordPress install creates one site, in one language. By activating WordPress multisite you can have many websites in a common install.

Before enabling multisites, decide if you want language sites as subdirectories of a main domain or as subdomains. For example:
http://www.example.org/subdirectory
http://subdomain.example.org/

Subdirectories are easier to set up and it’s less likely that you’ll have hosting compatibility problems later. If you really need subdomains check first if your hosting company/plan supports wildcard DNS for on-demand domain-based sites.

Follow the instructions on how to create a network of WordPress sites.

3 – Install adicional languages

Now you have your main network site in English, but you have to create the other language sites.

First you should download the language files you need and then upload them to the server. Upload the WordPress translation to your WordPress languages folder in: http://www.example.org/wp-content/languages/ and your theme translation to your theme languages folder. You can find the official language files in the WordPress i18n server. Upload only the language files with the .mo extension.

Please note that some themes aren’t prepared to work in multilingual mode by default, avoid them if possible. Translatable themes usually have a languages folder and a template file with a .pot extension.

Personally I use the desktop software Poedit to translate themes and plugins or to adapt existing translations, because it can easily scan the theme/plugin code and find all the untranslated expressions or translate from .pot files.

For more information on how to translate or modify an existing WordPress translation, check Translating WordPress and Localizing a WordPress Plugin using Poedit.

4 – Test language files with the Twenty Eleven theme

Create a WordPress site in your network for another language you are going to need. Don’t forget to define the website language in WordPress in:

Network Admin > Sites > (One of your sites) > Edit > Settings tab > WPLANG field

You should add the language code to the WPLANG field in the form. For example:

pt_PT for European Portuguese.

This code should match with the file names you have uploaded to your WordPress languages folder and to your theme languages folder:

http://www.example.org/wp-content/languages/

http://www.example.org/wp-content/themes/your_theme_folder/languages

for the example above, both files should be named pt_PT.mo and your_theme_folder should be twentyeleven

Now test the language translation in the site backend and using the “Twenty Eleven theme”.

At this point you should have a multilingual WordPress network installed on your server. Now lets look at implementing the campaign’s design.

Implement the design with child themes

Child themes are themes that modify, or add to, a parent theme. And that’s an awesome feature that WordPress has, and that many other CMS don’t. Child themes are great for multilingual websites because you can use them to adapt to the requirements of a specific language, without having to create new full templates.

For a multilingual site it’s recommended to have one parent theme common to all sites, and one or more child themes that each site may use. The parent theme shouldn’t be used directly, because changes on that theme will affect all language sites.

Teaching how to implement a design in WordPress is beyond the scope of this page, but here’s some general recommendations:

  • Create the parent theme by modifying a good and well documented base starter theme that fully supports translations
  • Decide if you want a responsive design approach to create a website that works well in all screen sizes:
    • If you do, select a responsive base starter theme like for example Skeleton or WordPress Bootstrap. Twenty Eleven default theme is also responsive and may be modified to be used as a parent theme.
    • Examples of non-responsive base starter themes are Thematic and Roots

Read more about starter themes and theme frameworks in the Theme frameworks page.

Some extra recommended plugins

Wordpress default functionality is great, but a network of websites may need some extra features. Fortunately WordPress is extensible and the plugins bellow (or similar alternatives) are recommended for most activism-related websites:

  • Si Captcha Anti Spam – If your site becomes popular and you accept blog comments, SPAM will arrive soon. A CAPTCHA may help reducing most of the spam as it blocks anything posted by bots. A good alternative to captchas is the Akismet plugin, but it’s not free for some uses.
  • Google Analytics for WordPress – Google Analytics is the best free website analytics software available, and it’s really powerful. You can have a Google Analytics account for all sites by adding the required tracking JavaScript to the parent theme or use this plugin instead. With this plugin each site can have it’s own independent Google Analytics account.
  • Improved Simpler CSS – Sometimes language site editors may want to change CSS just for their own language website, without affecting the other sites in the network. This plugin helps to do that.
  • Share and Follow – Social networks are very important to spread the campaign’s message. This plugin encourage sharing links in social networks by adding share buttons to the articles.
  • Google XML sitemaps – XML sitemaps help search engines like Google to find all your website content.
  • Redirection – With this plugin you will be able to set redirection rules from one or more URL’s to one or more destination URL’s.
  • WP Super Cache – With this plugin WordPress becomes faster and less resource demanding for the servers. Very useful to high traffic websites.

Because security and speed are very important in a website and plugins affect both, keep plugin usage to a minimum and do not install any plugin you don’t really need.

Notes on hosting

Wordpress hosting requirements are very easy to met. If you are creating a low-trafic website you can find a suitable and full featured hosting company with a shared hosting plan between 3 and 5 Euro a month, or even less!

But if you are building a website for dozens of thousands visitors a day, a cheap shared hosting plan will not be able to keep your website alive. Either the server crashes constantly, the site becomes too slow or the hosting company puts your website offline because it’s costing them much more to maintain it online than what you are paying for. You should try to predict how many visits a day will you have before you chose your hosting company/plan.

A successful activist website also risks sufferering from denial of service attacks (DoS or DDoS). And someone may explore security vulnerabilities to post spam. Your server must create daily backups automatically and save them in a different location, in case you need to recover from a successful attack.

When searching for hosting services look for managed hosting or grid hosting services. Companies like RackspaceMediatempleNearlyfreespeech or Amazon may have the hosting services you need. With managed hosting, the hosting company will be available to give you a personalized service, while with grid hosting the service may be more limited but the cost will be lower.

Conclusion

This article is a first approach on how to use WordPress to create a multilingual campaign website and not a full guide. If you already have some experience in setting up WordPress websites, then this article may help you to set your first multilingual multisite, but you’ll need to read other tutorials and WordPress manuals.

 

 

About Osvaldo

Digital activist, online producer and webmaster.
This entry was posted in Articles and tagged , , . Bookmark the permalink.

15 Responses to "Create a WordPress multilingual site"