Ver código fonte

fix: locale match error (#115)

tags/0.2.2
Joel 2 anos atrás
pai
commit
96809108ca
Nenhuma conta vinculada ao e-mail do autor do commit
1 arquivos alterados com 5 adições e 1 exclusões
  1. 5
    1
      web/middleware.ts

+ 5
- 1
web/middleware.ts Ver arquivo

@@ -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
}


Carregando…
Cancelar
Salvar