diff options
author | rahighi <rahighi> | 2021-08-29 08:41:31 +0430 |
---|---|---|
committer | rahighi <rahighi> | 2021-08-29 08:41:31 +0430 |
commit | f4ec386afac1eeee9418cd773f6f6e2e211d9e76 (patch) | |
tree | ab1916b7d811f258354d7442b0ea707b52bf0002 /modern/src/common | |
parent | 6587ea34698054175917aab54860bcac4bb38ff3 (diff) | |
download | etbsa-traccar-web-f4ec386afac1eeee9418cd773f6f6e2e211d9e76.tar.gz etbsa-traccar-web-f4ec386afac1eeee9418cd773f6f6e2e211d9e76.tar.bz2 etbsa-traccar-web-f4ec386afac1eeee9418cd773f6f6e2e211d9e76.zip |
Reverting unneeded changes
Diffstat (limited to 'modern/src/common')
-rw-r--r-- | modern/src/common/localization.js | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/modern/src/common/localization.js b/modern/src/common/localization.js index 6f3e585..5f1b886 100644 --- a/modern/src/common/localization.js +++ b/modern/src/common/localization.js @@ -1,5 +1,4 @@ import React, { useState, createContext, useContext, useEffect } from "react"; -import { create } from 'jss'; import af from '../../../web/l10n/af.json'; import ar from '../../../web/l10n/ar.json'; @@ -55,7 +54,6 @@ import uz from '../../../web/l10n/uz.json'; import vi from '../../../web/l10n/vi.json'; import zh from '../../../web/l10n/zh.json'; import zh_TW from '../../../web/l10n/zh_TW.json'; -import theme from "../theme"; const supportedLanguages = { af: { data: af, name: 'Afrikaans' }, @@ -115,17 +113,13 @@ const supportedLanguages = { }; export const languageList = Object.entries(supportedLanguages).map((values) => ({ code: values[0], name: values[1].name })); - const languages = localStorage.getItem('language') ? [localStorage.getItem('language')] : (window.navigator.languages !== undefined ? window.navigator.languages.slice() : []); - let language = localStorage.getItem('language') || window.navigator.userLanguage || window.navigator.language; - languages.push(language); languages.push(language.substring(0, 2)); languages.push('en'); for (let i = 0; i < languages.length; i++) { language = languages[i].replace('-', '_'); - if (language in supportedLanguages) { break; } @@ -158,7 +152,6 @@ export const LocalizationContext = createContext({ language }); - export function LocalizationProvider(props) { const [language, setLanguage] = useState(defaultLanguage); |