mikehaertl / localeurls

Automatic locale/language management for URLs
10 stars 3 forks source link

load multiple language code from same message folder #9

Closed farhad2161 closed 11 years ago

farhad2161 commented 11 years ago

i want to load message translation from same folder when a language have two different language code. For example in persian both "fa" and "fa_ir" should be translated from "\protected\messages\fa_ir" directory. I try to set config file like this

'request' => array(
            'class' => 'ext.localeurls.LocaleHttpRequest',
            'languages' => array(
                'en', 'en_us', 'english', 'eng',
                'fa'=>'fa_ir', 'fa_ir', 'farsi', 'far',
            ),
            'detectLanguage' => false,
),

but it does not work and i should have two different folder one for "fa" and other for "fa_ir".Is there any solution to have single folder "fa" and then connect both "fa" and "fa_ir" to this folder.

mikehaertl commented 11 years ago

If you use key=>value in your languages then the key relates to the URL string, and value the language you want to have. So maybe you should try something like

'languages' => array(
    'fa_ir' => 'fa',
    'fa',
    ..
),

By the way: english, eng, far and farsi are not valid values for the application language.

farhad2161 commented 11 years ago

thanks