浏览代码

fix: locale match error (#115)

tags/0.2.2
Joel 2 年前
父节点
当前提交
96809108ca
没有帐户链接到提交者的电子邮件
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5
    1
      web/middleware.ts

+ 5
- 1
web/middleware.ts 查看文件

@@ -23,7 +23,11 @@ export const getLocale = (request: NextRequest): Locale => {
}

// match locale
const matchedLocale = match(languages, locales, i18n.defaultLocale) as Locale
let matchedLocale:Locale = i18n.defaultLocale
try {
// If languages is ['*'], Error would happen in match function.
matchedLocale = match(languages, locales, i18n.defaultLocale) as Locale
} catch(e) {}
return matchedLocale
}


正在加载...
取消
保存