소스 검색

fix: locale match error (#115)

tags/0.2.2
Joel 2 년 전
부모
커밋
96809108ca
No account linked to committer's email address
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
}


Loading…
취소
저장