summaryrefslogtreecommitdiff
path: root/front/src/App.tsx
diff options
context:
space:
mode:
authorphyscik <mynameisgennadiy@vk.com>2026-04-11 17:12:18 +0500
committerphyscik <mynameisgennadiy@vk.com>2026-04-11 17:12:18 +0500
commitebbadf94dd4b23b9ceabd402ed0886c4cd8c6062 (patch)
tree5ecb0a950bc4ccd39a1c002a37c042950a8f91be /front/src/App.tsx
parent5d2c8369389013895264caf16e71d44bddabb22c (diff)
Localization persistance
Diffstat (limited to 'front/src/App.tsx')
-rw-r--r--front/src/App.tsx4
1 files changed, 3 insertions, 1 deletions
diff --git a/front/src/App.tsx b/front/src/App.tsx
index a685379..6bfce7b 100644
--- a/front/src/App.tsx
+++ b/front/src/App.tsx
@@ -7,6 +7,7 @@ import ClassesList from './Emelents/ClassList';
import Topbar from './Emelents/Topbar';
import { AllowedLanguages, LanguageContext } from './Locales/Context';
import { useState } from 'react';
+import { ReadCurrentLocale, SaveCurrentLocale } from './Locales/Locales';
const router = createBrowserRouter([
{
@@ -20,10 +21,11 @@ const router = createBrowserRouter([
]);
function App() {
- const [lang, setLang] = useState<AllowedLanguages>("en");
+ const [lang, setLang] = useState<AllowedLanguages>(ReadCurrentLocale());
function SetLanguage(newLang: AllowedLanguages) {
console.log(`Setting a new language ${newLang}...`);
+ SaveCurrentLocale(newLang);
setLang(newLang);
}