Only one english translation

Hi there,

I’m programming a multilanguage website in Yii but wondering how i can support all english languages without having to do both “en_au”, “en_us” etc. folders in each view folder. I think people are satisfied if just the language is english.

Right now I’m using “Yii::app()->request->preferredLanguage” to obtain the users preferred language.


It really confuses me that

Yii::app()->language = 'da_dk'

sets the correct CLocale and

Yii::app()->language = 'da'

doesn’t, but the later is the right format for the built in “messages” folder in the framework.

You can implement english like base language, and leave untranslated all message you don’t want to translate.

Or you can change a bit the assignement of the preferredLanguage, and choose en_us for any english variant.

Okay, thanks.

Isn’t it strange that the core messages in the framework is en the short format? When CLocale is only correct, if the long version is used?

NOTE: merged duplicate posts

What I find problematic with this behaviour is that if you set the site language to da_DK all the Yii/Zii errors start to appear in English, because the only language files are for just "da". We worked around this by rolling a custom message class that look just the language part of the locale and loaded those ones in for core messages.

This probably a bit OT, but is it possible to have URL rules translated too?