Parcourir la source

fix: locale match error (#115)

tags/0.2.2
Joel il y a 2 ans
Parent
révision
96809108ca
Aucun compte lié à l'adresse e-mail de l'auteur
1 fichiers modifiés avec 5 ajouts et 1 suppressions
  1. 5
    1
      web/middleware.ts

+ 5
- 1
web/middleware.ts Voir le fichier

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


Chargement…
Annuler
Enregistrer