From 348b8ea777ed7695f50db430fbff6a1c59938c54 Mon Sep 17 00:00:00 2001 From: Jamie Guthrie Date: Wed, 16 Aug 2023 18:58:41 +0200 Subject: Localization falls back to 'en' if translation cannot be found --- modern/src/common/components/LocalizationProvider.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modern/src/common/components/LocalizationProvider.js b/modern/src/common/components/LocalizationProvider.js index 6bc64831..9c51841c 100644 --- a/modern/src/common/components/LocalizationProvider.js +++ b/modern/src/common/components/LocalizationProvider.js @@ -178,7 +178,7 @@ export const useLocalization = () => useContext(LocalizationContext); export const useTranslation = () => { const context = useContext(LocalizationContext); const { data } = context.languages[context.language]; - return useMemo(() => (key) => data[key], [data]); + return useMemo(() => (key) => (data[key] ? data[key] : context.languages.en.data[key]), [data]); }; export const useTranslationKeys = (predicate) => { -- cgit v1.2.3