mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-12 06:19:03 +08:00
fix: locale match error (#115)
This commit is contained in:
parent
8fc2663693
commit
96809108ca
@ -23,7 +23,11 @@ export const getLocale = (request: NextRequest): Locale => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// match 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
|
return matchedLocale
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user