First post of the new oncleben31.cc to share how I’ve setup WordPress to make a bilingual blog using the multisite feature. This can be easily extaneded for multilingual blogs.
I need two independent sites to facilitate the plugins and theme localization with an easy way to switch between languages if a translation is available. Another reason is to optimize the search engine indexing. With this solution I can have some language specific posts without translation.
Below I explain how I’ve implement that with WordPress:
- Setup of the WordPress multisite feature. If you don’t know it, it allow to have many WordPress site with only one installation. Administration is simplified and updates are done only once. To have more information go and read the multisite documentation.
- I have a root blog (oncleben31.cc/) which is useless (see step n°4), a french blog (oncleben31.cc/fr/) and an english blog (oncleben31.cc/en/). The language is setup in wordpress settings. Benefits: I can have specific plugins or theme for each language if needed.
- I use the Multisite Language Switcher by lloc plugin to display a link in the side bar to go to the other language (sources hosted on github). This plugin is really useful: it allows to display a link to the other available language and it allows to add a link to the translation of a post or a page if available too. This feature is eased by adding a drop down list in the edit view.
- The last thing is about managing visitor coming directly on ”http://oncleben31.cc/”. Indeed the root website is a third wordpress blog not in french nor in english. I made a hack to redirect users in function of the preferred language return by the browser. To do that I’ve created the ”Multisite Language Switcher Theme” theme which doesn’t display any content but manage the redirection (theme detailed in this post). To avoid disorientating your visitor this theme manages 404 errors too . You can find the theme’s sources and improve it on Github.
Setting up a multilingual blog is not easy and I’ve search a long time to find the good solution corresponding to my needs. If you have simular needs let’s try this solution and share your experiences in the comments.
No related posts.
Français