aboutsummaryrefslogtreecommitdiff
path: root/modern/src/common/components/LocalizationProvider.js
diff options
context:
space:
mode:
Diffstat (limited to 'modern/src/common/components/LocalizationProvider.js')
-rw-r--r--modern/src/common/components/LocalizationProvider.js114
1 files changed, 58 insertions, 56 deletions
diff --git a/modern/src/common/components/LocalizationProvider.js b/modern/src/common/components/LocalizationProvider.js
index 0df242dc..bcddd1b2 100644
--- a/modern/src/common/components/LocalizationProvider.js
+++ b/modern/src/common/components/LocalizationProvider.js
@@ -1,60 +1,60 @@
import React, { createContext, useContext, useMemo } from 'react';
-import usePersistedState from '../util/usePersistedState';
-import af from '../../../../web/l10n/af.json';
-import ar from '../../../../web/l10n/ar.json';
-import az from '../../../../web/l10n/az.json';
-import bg from '../../../../web/l10n/bg.json';
-import bn from '../../../../web/l10n/bn.json';
-import cs from '../../../../web/l10n/cs.json';
-import da from '../../../../web/l10n/da.json';
-import de from '../../../../web/l10n/de.json';
-import el from '../../../../web/l10n/el.json';
-import en from '../../../../web/l10n/en.json';
-import es from '../../../../web/l10n/es.json';
-import fa from '../../../../web/l10n/fa.json';
-import fi from '../../../../web/l10n/fi.json';
-import fr from '../../../../web/l10n/fr.json';
-import he from '../../../../web/l10n/he.json';
-import hi from '../../../../web/l10n/hi.json';
-import hr from '../../../../web/l10n/hr.json';
-import hu from '../../../../web/l10n/hu.json';
-import id from '../../../../web/l10n/id.json';
-import it from '../../../../web/l10n/it.json';
-import ja from '../../../../web/l10n/ja.json';
-import ka from '../../../../web/l10n/ka.json';
-import kk from '../../../../web/l10n/kk.json';
-import km from '../../../../web/l10n/km.json';
-import ko from '../../../../web/l10n/ko.json';
-import lo from '../../../../web/l10n/lo.json';
-import lt from '../../../../web/l10n/lt.json';
-import lv from '../../../../web/l10n/lv.json';
-import ml from '../../../../web/l10n/ml.json';
-import mn from '../../../../web/l10n/mn.json';
-import ms from '../../../../web/l10n/ms.json';
-import nb from '../../../../web/l10n/nb.json';
-import ne from '../../../../web/l10n/ne.json';
-import nl from '../../../../web/l10n/nl.json';
-import nn from '../../../../web/l10n/nn.json';
-import pl from '../../../../web/l10n/pl.json';
-import pt from '../../../../web/l10n/pt.json';
-import ptBR from '../../../../web/l10n/pt_BR.json';
-import ro from '../../../../web/l10n/ro.json';
-import ru from '../../../../web/l10n/ru.json';
-import si from '../../../../web/l10n/si.json';
-import sk from '../../../../web/l10n/sk.json';
-import sl from '../../../../web/l10n/sl.json';
-import sq from '../../../../web/l10n/sq.json';
-import sr from '../../../../web/l10n/sr.json';
-import sv from '../../../../web/l10n/sv.json';
-import ta from '../../../../web/l10n/ta.json';
-import th from '../../../../web/l10n/th.json';
-import tr from '../../../../web/l10n/tr.json';
-import uk from '../../../../web/l10n/uk.json';
-import uz from '../../../../web/l10n/uz.json';
-import vi from '../../../../web/l10n/vi.json';
-import zh from '../../../../web/l10n/zh.json';
-import zhTW from '../../../../web/l10n/zh_TW.json';
+import af from 'traccar-web/web/l10n/af.json';
+import ar from 'traccar-web/web/l10n/ar.json';
+import az from 'traccar-web/web/l10n/az.json';
+import bg from 'traccar-web/web/l10n/bg.json';
+import bn from 'traccar-web/web/l10n/bn.json';
+import cs from 'traccar-web/web/l10n/cs.json';
+import da from 'traccar-web/web/l10n/da.json';
+import de from 'traccar-web/web/l10n/de.json';
+import el from 'traccar-web/web/l10n/el.json';
+import en from 'traccar-web/web/l10n/en.json';
+import es from 'traccar-web/web/l10n/es.json';
+import fa from 'traccar-web/web/l10n/fa.json';
+import fi from 'traccar-web/web/l10n/fi.json';
+import fr from 'traccar-web/web/l10n/fr.json';
+import he from 'traccar-web/web/l10n/he.json';
+import hi from 'traccar-web/web/l10n/hi.json';
+import hr from 'traccar-web/web/l10n/hr.json';
+import hu from 'traccar-web/web/l10n/hu.json';
+import id from 'traccar-web/web/l10n/id.json';
+import it from 'traccar-web/web/l10n/it.json';
+import ja from 'traccar-web/web/l10n/ja.json';
+import ka from 'traccar-web/web/l10n/ka.json';
+import kk from 'traccar-web/web/l10n/kk.json';
+import km from 'traccar-web/web/l10n/km.json';
+import ko from 'traccar-web/web/l10n/ko.json';
+import lo from 'traccar-web/web/l10n/lo.json';
+import lt from 'traccar-web/web/l10n/lt.json';
+import lv from 'traccar-web/web/l10n/lv.json';
+import ml from 'traccar-web/web/l10n/ml.json';
+import mn from 'traccar-web/web/l10n/mn.json';
+import ms from 'traccar-web/web/l10n/ms.json';
+import nb from 'traccar-web/web/l10n/nb.json';
+import ne from 'traccar-web/web/l10n/ne.json';
+import nl from 'traccar-web/web/l10n/nl.json';
+import nn from 'traccar-web/web/l10n/nn.json';
+import pl from 'traccar-web/web/l10n/pl.json';
+import pt from 'traccar-web/web/l10n/pt.json';
+import ptBR from 'traccar-web/web/l10n/pt_BR.json';
+import ro from 'traccar-web/web/l10n/ro.json';
+import ru from 'traccar-web/web/l10n/ru.json';
+import si from 'traccar-web/web/l10n/si.json';
+import sk from 'traccar-web/web/l10n/sk.json';
+import sl from 'traccar-web/web/l10n/sl.json';
+import sq from 'traccar-web/web/l10n/sq.json';
+import sr from 'traccar-web/web/l10n/sr.json';
+import sv from 'traccar-web/web/l10n/sv.json';
+import ta from 'traccar-web/web/l10n/ta.json';
+import th from 'traccar-web/web/l10n/th.json';
+import tr from 'traccar-web/web/l10n/tr.json';
+import uk from 'traccar-web/web/l10n/uk.json';
+import uz from 'traccar-web/web/l10n/uz.json';
+import vi from 'traccar-web/web/l10n/vi.json';
+import zh from 'traccar-web/web/l10n/zh.json';
+import zhTW from 'traccar-web/web/l10n/zh_TW.json';
+import usePersistedState from '../util/usePersistedState';
const languages = {
af: { data: af, name: 'Afrikaans' },
@@ -143,8 +143,10 @@ const LocalizationContext = createContext({
export const LocalizationProvider = ({ children }) => {
const [language, setLanguage] = usePersistedState('language', getDefaultLanguage());
+ const value = useMemo(() => ({ languages, language, setLanguage }), [languages, language, setLanguage]);
+
return (
- <LocalizationContext.Provider value={{ languages, language, setLanguage }}>
+ <LocalizationContext.Provider value={value}>
{children}
</LocalizationContext.Provider>
);