Multilanguage
This page describes how to setup new language. And how to translate.
Currently there are twenty one translated languages.
- English (en_EN) - it's default system language and no translations file is needed.
- Lithuanian (lt_LT) - it's my native language :), so I make translations to this language.
- Danish - (da_DA) (Based on google translations)
- German - (de_DE) (Based on google translations)
- Spanish - (es_ES) (Based on google translations)
- French - (fr_FR) (Based on google translations)
- Indian - (hi_HI) (Based on google translations)
- Italian - (it_IT) (Based on google translations)
- Japan - (ja_JA) (Based on google translations)
- Norwegian - (no_NO) (Based on google translations)
- Portugal - (pt_PT) (Based on google translations)
- Russian - (ru_RU) (Based on google translations)
- Czech - (cs_CS) (Based on google translations)
- Croatia - (hr_HR) (Based on google translations)
- Icelandic - (is_IS) (Based on google translations)
- Finnish - (fi_FI) (Based on google translations)
- Romanian - (ro_RO) (Based on google translations)
- Swedish - (sv_SV) (Based on google translations)
- Belarusian - (be_BE) (Based on google translations)
- Ukrainian - (uk_UK) (Based on google translations)
- Turkish - (tr_TR) (Based on google translations)
- Polish - (pl_PL) (Based on google translations)
How translations works
Translations not only translates content but also implements full module url translations. None of image gallery I know has this feature. And this feature is really useful for multi-language site. Gallery fully satisfies requirements mentioned here. http://seo2.0.onreact.com/user-and-search-friendly-url-design-for-multi-language-websites-in-4-easy-steps except the last one, witch I think could make some mess if two languages modules translations are the same, and this can happen.
Making new translation
All languages shortnames is based on:
- http://www.iso.org/iso/support/country_codes/iso_3166_code_lists/iso-3166-1_decoding_table.htm
- http://www.w3.org/WAI/ER/IG/ert/iso639.htm
- http://www.seoconsultants.com/meta-tags/language
- http://en.wikipedia.org/wiki/ISO_3166-1_alpha-3
- http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
If we want to make, let say French translations, first we have to create a folder with approriate name in translations folder. This time it would look like 'fr_FR'. Then i suggest just copy translations.xml from Lithuanian translation folder.
Next thing we have to do is adjust siteccess settings. Unchanged default english language settings looks like:
array (
'eng' =>
array (
'locale' => 'en_EN',
'content_language' => 'en',
'theme' =>
array (
0 => 'frontend',
1 => 'defaulttheme',
),
),
And changed will look like.
array (
'fre' =>
array (
'locale' => 'fr_FR',
'content_language' => 'fr',
'theme' =>
array (
0 => 'frontend',
1 => 'defaulttheme',
),
),
),
Please notice that I also changed from 'eng' to 'fre'. In order to access french version you will have to type /fre/ at the end of address, or you can change 'default_site_access' value. Default language then will be french.
If you want to generate new language file. It can be done by executing this command.
php ./bin/php/generate_translation_file.php -l <language> -a `<api_key>`
<language> - target langugage ex. lt_LT
<api_key> - api can be optained from google. http://code.google.com/apis/console
Supported automate translate languages can be found here. http://code.google.com/apis/language/translate/v2/using_rest.html#language-params
Back »

Comments: 0
Leave a reply »