laravel-localization
laravel-localization copied to clipboard
Update supportedLocales, improvements of Chinese
English is not my native language; please excuse typing errors.
This config only use zh and zh-Hant in supportedLocales:
//'zh' => ['name' => 'Chinese (Simplified)', 'script' => 'Hans', 'native' => ' 简体中文 ', 'regional' => 'zh_CN'],
//'zh-Hant' => ['name' => 'Chinese (Traditional)', 'script' => 'Hant', 'native' => ' 繁體中文 ', 'regional' => 'zh_CN'],
Infact, the relationships of Chinese are like below:
- zh: Chinese
- zh-Hans: Simplified Chinese
- zh-CN: Simplified Chinese, Mainland China
- zh-SG: Simplified Chinese, Singapore
- zh-MY: Simplified Chinese, Malaysia
- zh-Hant: Traditional Chinese
- zh-TW: Traditional Chinese, Taiwan
- zh-HK: Traditional Chinese, Hong Kong
- zh-MO: Traditional Chinese, Macau
- zh-Hans: Simplified Chinese
The first problem of this config is, 繁體中文 - Chinese (Traditional) is mainly used in Taiwan, Hong Kong and Macau, so I think regional of zh-Hant should be better changed to zh-TW.
The second problem is, currently most browsers only use zh-CN, zh-TW, zh-HK in the "Accept-Language" field.
Here are two screenshoots:
This screenshot is from Chrome, I will translate the options line by line as below:
- Chinese —— zh
- Traditional Chinese —— zh-TW
- Simplified Chinese —— zh-CN
- Chinese (Hong Kong) —— zh-HK
Firefox provides us with more opinion, I will also translate the options line by line as below:
- Chinese —— zh
- Chinese (Taiwan) —— zh-TW
- Chinese (Singapore) —— zh-SG
- Chinese (Mainland China) —— zh-CN
- Chinese (Hong Kong) —— zh-HK
Besides, the Laravel Lang project provides Chinese translation in zh-CN, zh-TW and zh-HK. When I use your project for the first time, the Accept-Language of my browser are zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2
, but the localized URL returned zh and shown English, which confused me a lot.
So, I think it's better to add zh-CN, zh-TW and zh-HK, with zh-SG and zh-MY which are listed in zh.wikipedia.org by the way. And for those who do not want to maintain the regional language, it's also necessray to keep zh-Hans and zh-Hant.