Add language alias for zh_HANS_CN

This commit is contained in:
printempw 2018-02-22 18:32:53 +08:00
parent 90af85d00f
commit c2855e2e1d
2 changed files with 3 additions and 5 deletions

View File

@ -22,11 +22,6 @@ class DetectLanguagePrefer
{
$locale = $request->input('lang') ?: ($request->cookie('locale') ?: $request->getPreferredLanguage());
// For Microsoft Edge and IE
if ($locale == 'zh_HANS_CN') {
$locale = 'zh_CN';
}
// If current locale is an alias of other locale
if (($info = array_get(config('locales'), $locale)) && ($alias = array_get($info, 'alias'))) {
$locale = $alias;

View File

@ -13,6 +13,9 @@ return [
'name' => '中文 (简体)',
'short_name' => 'ZH (CN)',
],
'zh_HANS_CN' => [
'alias' => 'zh_CN',
],
'en' => [
'name' => 'English',
'short_name' => 'EN',