Showing posts with label i18n. Show all posts
Showing posts with label i18n. Show all posts

Wednesday, August 3, 2011

Translation/Locale Xliff based module is done

My Question on Support site for LampCMS project

Hello!
I know it has been a long time since the last post. I am very busy these days and only have several hours a week to work on this project.

I finally finished the Translation module for this site. Translation module is done using Xliff standard. I'm sure you can Google it if you don't know what it is.

The code is in the latest commit on github

So far I have translated 52 strings (there has gotto be at least as many left to translate) into Russian language.
I don't know any other languages and even my Russian is rusty.

You can test it by selecting Russian from the drop-down menu at the bottom of this site.

Anyway, the Russian translations file is a good example of how you can translate this site into any other language.

You need to just copy the file from /translations/messages.ru.xlf into your own language and save the new file as /translations/messages.fr.xlf (if you going to be using French)

You can also use Locale-specific translations, for example messages.en_GB.xlf

Remember that .xlf files are xml files and must be a valid xml.

If you want to contribute your own translations just send me a copy of your own .xlf translation file.

To add more language options to your site add more locale choices to your config.ini file
There is now a [LOCALES] section in it.

Add something like this:

[LOCALES]
en_US = "English (United States)"
en_GB = "English (United Kingdom)"
fr_FR = "French"
fr_CA = "French (Canadian)"
de = "German"
es = "Spanish (Spain)"
ru_RU = "Russian"

These will become the choices in the drop-down menu at the bottom of the pages.

Click here to post your reply


Thursday, June 30, 2011

Internationalization for LampCMS using XLIFF

My Question on Support site for LampCMS project

I was researching the topic of Internationalization and was considering different solutions.
I was more inclined to store translation strings right in the Mongo Database.

But then after looking at what other projects are using I came across something interesting. Symfony2 uses XLIFF as preferred method to store translated strings. So I looked at that XLIFF format, and I really like it. At first it looked like it would be complicated for users to create their xml files. But then I found that there are several GUI editors for XLIFF files. One of them is a plugin for Eclipse. I use Eclipse all the time anyway, that's my preferred IDE.

There is also a web-based program that allows you to setup a translation project, define desired languages and let volunteers to contribute translations and at the end it creates valid XLIFF flies.

I think it's really cool. So am thinking now if to use Symfony's existing Translator class or to write my own which will be more lightweight (Symfony is great but as always it can do alot more that I need for this project and most importantly it does not have one feature I really like to see). I will try to get in touch with Symfony developers and see if that can add that extra small feature I want. If it does not work out then I'll write my own Translator class.

Click here to post your reply