Codex

Multilingual WordPress

WordPress does not support a bilingual or multilingual blog out-of-the-box. There are however Plugins developed by the WordPress community which will allow you to create a multilingual blog easily.

Creating a mulitlingual blog is basically installing WordPress in more than one language and letting the Plugin switch between them. This includes installing .mo languages files which most Plugins will require you to do manually. See Installing_WordPress_in_Your_Language for details. There are Plugins around which will do this for you (for example qTranslate and WPML).

Contents

Different types of multilingual plugins

There are two basic types of multilingual Plugins:

  1. Manage multilingual posts in one post per language (for example Gengo and WPML). Translations are then linked together, indicating that one page is the translation of another.
  2. Store all languages alternatives for each post in the same post (for example qTranslate).

One language per post

Multilingual plugins that assign a single language per post will let the user select the post's language and add translations as new posts (same for pages, tag and categories).

Then, different versions of the same content are linked together to form translation groups. This grouping allows users to switch the display language.

Pros:

  1. The database contents for posts remain unmodified (easy install and uninstall).
  2. Everything gets translated by default. If a post includes custom fields, they're attached to that post, so they are already associated with the language.
  3. Other plugins that analyze contents (like related posts) keep working correctly.

Cons:

  1. More complex architecture. The plugin needs to hook to many WordPress functions and filter them so that only contents that matches the language is returned.
  2. Additional tables are required - normally, to hold the translation grouping.

All languages in a single post

Multilingual plugins that hold all the language contents in the same post use language meta tags to distinguish between contents in different languages. When the post is displayed, it's first processed and only the active language content remains.

Pros:

  1. Side by side editing is easily implemented.
  2. Less things to break. There are no additional tables and much fewer things to modify in WordPress.

Cons:

  1. In order to create multilingual contents, the user needs to insert the language tags manually, to everything the plugin doesn't hook to.
  2. Uninstall can be complicated, as the database needs to be cleaned from multilingual contents.

Each language in its own WordPress installation

No public plugin exists, but its a valid conceptual option with private implementations in the wild. A separate site is created for each language you want to translate into (e.g. in a WordPress MU installation). All the sites need to run the same theme and plugin. When a translation is saved source posts get pinged by translation posts and the system keeps a separate table with the translation relationships.

Pros:

  1. Each language site is a regular WP install with regular posts (postmeta and external db is used for translation data)
  2. If you turn off the plugin the content continues to work fine, albeit without knowledge of its sources/translations.

Cons:

  1. No plugins exist: Good luck!
  2. Separate sites create more management needs which might be undesirable.

Language negotiation

Language negotiation means who to determine the language in which users see the site.

Regardless of the solution for storing multilingual contents, multilingual plugins also need to be able to choose which language to display in.

Normally, the URL indicates the display language. Different URL strategies for encoding language information are:

  • Add the language name as a parameter: samples.com/?lang=en or samples.com/?lang=es
  • Add virtual 'directories' as language names: example.com/en/ or example.com/es/
  • Use different domains for different languages: www.example.com or es.example.com

How to choose the right multilingual solution

Choosing the most suitable multilingual Plugin for your needs will take some time. See the WordPress Plugin Directory for a list of multilingual Plugins.

In any case, installing a multilingual plugin is a big change for any site. It would be a good idea to first create a test site and verify that everything works correctly between all the required plugins and the theme and only then install.

Since any multilingual plugin changes the database significantly, doing a database backup is required before experimenting.

Related