i18n: setting different yii coreMessages' language and my App's language?

Hello,

I have a translation in protected/messages/ru_ru/w3.php

I’m setting yii to use it with


Yii::app()->language='ru_ru';

what I need to do is to ask Yii core messages to appear in ‘ru’.

Qiang, is this possible?

So, I get captcha’s “Get a new code” and other yii core messages in a language I want (in this case, russian).

Then I’ll set my application language to be ‘ru_ua’ and will need Yii’s core language to be ‘uk’ (ukrainean).

If this is not currently possible, I’ll use the same LanguageID as yii does until this feature will be added.

Thanks! Yii does a great work with internationalization!

P.S. I translate using file_put_contents(‘t.txt’, iconv(‘windows-1251’,‘UTF-8’,$t));

Yii doesn’t support locale inheritance (i.e., ru_ua inherits ru). For this reason, you need to set your language ID to be ‘ru’ in order to use the existing Yii core messages. If ru_ua is a requirement, you may refer to the following tutorial to resolve your problem:

http://www.yiiframework.com/doc/cookbook/18/

Hi Qiang,

Thanks for the reply.

I might follow your language codes so far. Tried to look at http://cldr.unicode.org/ and couldn’t find the code languages you are using.

Is it ISO 639-1, like here http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes (first column)?

I like your approach naming a language with 2 chars (e.g. ‘ru’) rather than my approach with 5 chars (‘ru_ua’), and ‘ru_ua’ isn’t a requirement of this project.

Just need to know where it comes from.

Thanks in advance!