From ebbadf94dd4b23b9ceabd402ed0886c4cd8c6062 Mon Sep 17 00:00:00 2001
From: physcik <mynameisgennadiy@vk.com>
Date: Sat, 11 Apr 2026 17:12:18 +0500
Subject: Localization persistance

---
 front/src/App.tsx | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

(limited to 'front/src/App.tsx')

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);
     }
 
-- 
cgit v1.3

