aboutsummaryrefslogtreecommitdiff
path: root/modern/src/LocalizationProvider.js
diff options
context:
space:
mode:
Diffstat (limited to 'modern/src/LocalizationProvider.js')
-rw-r--r--modern/src/LocalizationProvider.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/modern/src/LocalizationProvider.js b/modern/src/LocalizationProvider.js
index 84419683..bf454e71 100644
--- a/modern/src/LocalizationProvider.js
+++ b/modern/src/LocalizationProvider.js
@@ -158,10 +158,12 @@ export const useLocalization = () => {
export const useTranslation = () => {
const context = useContext(LocalizationContext);
- return (key) => context.languages[context.language].data[key];
+ const data = context.languages[context.language];
+ return (key) => data[key];
};
export const useTranslationKeys = (predicate) => {
const context = useContext(LocalizationContext);
- return Object.keys(context.languages[context.language].data).filter(predicate);
+ const data = context.languages[context.language];
+ return Object.keys(data).filter(predicate);
};