Merged in fix/BOOK-399-default-language (pull request #2877)
fix(BOOK-399): Default language to 'en' when we've ended up in a invalid state * fix(BOOK-399): Default language to 'en' when we've ended up in a invalid state * PR fixes: reuse types and include local dev error message Approved-by: Anton Gunnarsson Approved-by: Linus Flood
This commit is contained in:
@@ -13,6 +13,10 @@ const cache = createIntlCache()
|
||||
const instances: Partial<Record<Lang, IntlShape>> = {}
|
||||
|
||||
export async function getMessages(lang: Lang): Promise<Record<string, string>> {
|
||||
if (!Lang[lang]) {
|
||||
lang = Lang.en
|
||||
}
|
||||
|
||||
return (await import(`./dictionaries/${lang}.json`)).default
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user