I have the following piece of code and am trying to do something simple with the Zend framework and Zend_Locale()
$supported_langs = array(
'en' => 'English',
'zh_CN' => '中文(简体)',
'zh_HK' => '中國(傳統)',
'es' => 'Español',
'ja' => '日本',
'pt' => 'Português',
'de' => 'Deutsch',
'ar' => 'العربية',
'fr' => 'Française',
'ru' => 'Pусский',
'ko' => '한국의',
'hi' => 'हिन्दी',
'vi' => 'Việt'
);
echo '<pre>';
foreach ($supported_langs as $lang => $desc) {
print Zend_Locale::getTranslation($lang, 'language', 'en') . "\n";
}
echo '</pre>';
The output from the above is:
English
Spanish
Japanese
Portuguese
German
Arabic
French
Russian
Korean
Hindi
Vietnamese
zh_CN
, zh_HK
don't provide output. If I change one of the zh values to zh
, it prints out Chinese, which is Ok, I suppose, but doesn't quite work the way I hoped?
zh_CN and zh_HK are two different languages ... I would like to be able to print the translation for both ...without over simplifying it to just Chinese...
Edit
Turns out, if I use zh_Hans
and zh_Hant
then it prints out as correct. So I suppose:
Question: why doesn't the Zend_Locale honor the abbreviated formats like zh_HK or zh_CN?