mirror of
http://112.124.100.131/huang.ze/ebiz-dify-ai.git
synced 2025-12-07 09:56:49 +08:00
fix: locale match error (#115)
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user