From 5d2c8369389013895264caf16e71d44bddabb22c Mon Sep 17 00:00:00 2001
From: physcik <mynameisgennadiy@vk.com>
Date: Sat, 11 Apr 2026 16:40:22 +0500
Subject: Language toggle

---
 front/src/Emelents/Sidebar.tsx | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

(limited to 'front/src/Emelents/Sidebar.tsx')

diff --git a/front/src/Emelents/Sidebar.tsx b/front/src/Emelents/Sidebar.tsx
index b138de6..4802e76 100644
--- a/front/src/Emelents/Sidebar.tsx
+++ b/front/src/Emelents/Sidebar.tsx
@@ -1,10 +1,21 @@
+import { useContext } from 'react';
+import { AllowedLanguages, LanguageContext } from '../Locales/Context';
+import { GetString } from '../Locales/Locales';
 import './Elements.css';
 
-function Sidebar() {
+type SidebarProps = {
+    setLang: (newLang: AllowedLanguages) => void;
+};
+
+function Sidebar({setLang}: SidebarProps) {
+    var language = useContext(LanguageContext);
+
     return (
         <nav className='Sidebar'>
             <div className='SidebarContents'>
-                <h1> Contents </h1>
+                <button onClick={() => setLang("ru")}> ru </button>
+                <button onClick={() => setLang("en")}> en </button>
+                <h1> {GetString("contents", language)} </h1>
                 <ul>
                 </ul>
             </div>
-- 
cgit v1.3

