fix(i18n): 修复了无法正确无视大小写导致无法识别的问题

Signed-off-by: 李东云 <dongyu.li@luxcreo.ai>
This commit is contained in:
李东云
2023-09-26 16:23:16 +08:00
parent fcb0cd8852
commit 73420153d3
2 changed files with 2 additions and 1 deletions

View File

@@ -19,7 +19,7 @@ enum Languages: string
public static function getLanguage(string $language): Languages
{
return match ($language) {
return match (mb_strtolower($language)) {
'en', 'en_us', 'en-us', 'en-uk', 'en_uk' => self::EN,
'zh', 'zh_cn', 'zh-cn' => self::ZH_CN,
default => self::from(config('translation.locale')),