-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Milestone
Description
MiddleWare/Localize line 60:
foreach ($supportedLanguages as $language) {
$language = substr($language, 0, 2);
if (isset($this->langs[$language])) {
$userLanguage = $language;
break;
}
}the code above have two bugs:
- It dosn't distinguish zh-CN and zh-TW.
- both language package of zh-CN and zh-TW contain '-', but the spliter of browser's accept-language is '_'.
so, I think the right code is:
$language = str_replace('_', '-', $language);Metadata
Metadata
Assignees
Labels
No labels