Cielito Lindo Productions

Discovering the beauty of God's creation | And it was very good

Enable Multi-language support on a koken site

Recently I was looking for a way to add to my koken site the possibility to change between different languages. I found a plugin but in order to use it it is necessary to change quite a few files in the server php code - not bad but difficult to maintain.

A different approach was to translate the content directly on the client side - the browser. One framework I found was i18next. With i18nextify they offer a way to add easily translations to any page. So I wrote a small koken plugin that integrates i18nextify. You can find it here.

It automatically detects the language of the browser and selects the appropriate translation of your text, additionally you can add a language selector to your theme

Furthermore the plugin offers the possibility to save the translation files in the browser of your visitor and therefore avoid retrieving them from the server on every page reload.

The Readme on github describes how to get everything set up.

If you want to bring things a bit further you can think about using a translation management system. This is (in most cases an online) platform on which you upload your translation files and translate your content in a nice dashboard rather than editing json files in a text editor locally on your computer. With them you can also easily add new languages.

Some translation systems that you could give a try are the following:

  • They offer 1000 strings for free (if you translate 1 string into 3 languages this actually counts as 3 strings)
  • They offer 500 strings for free - no matter into how many languages you translate
  • They are not for free but tie together very nice with i18nextify as both are made by the same people

Hint: Please note that this plugin is about translating what your site visitor sees - not about translating the admin dashboard.