i18n: Fix theme toggle

This commit is contained in:
Michal Šmahel committed 2025-06-09 21:53:03 +02:00
1 parent d63e3db216
commit 6b81eabf07
11 files changed
+43 -11

No files matched your search

+3 -1
View File
@@ -14,10 +14,12 @@ import SunAndMoonIcon from "./SunAndMoonIcon";
import { useDispatch, useSelector } from "react-redux"; import { useDispatch, useSelector } from "react-redux";
import { setMode } from "../../Features/UI/uiSlice"; import { setMode } from "../../Features/UI/uiSlice";
import "./index.css"; import "./index.css";
import {useTranslation} from "react-i18next";
const ThemeSwitch = ({ width = 48, height = 48, color }) => { const ThemeSwitch = ({ width = 48, height = 48, color }) => {
const mode = useSelector((state) => state.ui.mode); const mode = useSelector((state) => state.ui.mode);
const dispatch = useDispatch(); const dispatch = useDispatch();
const { t } = useTranslation();
const toggleTheme = () => { const toggleTheme = () => {
dispatch(setMode(mode === "light" ? "dark" : "light")); dispatch(setMode(mode === "light" ? "dark" : "light"));
@@ -26,7 +28,7 @@ const ThemeSwitch = ({ width = 48, height = 48, color }) => {
return ( return (
<IconButton <IconButton
id="theme-toggle" id="theme-toggle"
title="Toggles light & dark" title={t("common.buttons.toggleTheme")}
className={`theme-${mode}`} className={`theme-${mode}`}
aria-label="auto" aria-label="auto"
aria-live="polite" aria-live="polite"
+4 -1
View File
@@ -1,7 +1,10 @@
{ {
"common": { "common": {
"appName": "Checkmate", "appName": "Checkmate",
"monitoringAgentName": "Capture" "monitoringAgentName": "Capture",
"buttons": {
"toggleTheme": "Přepnout mezi světlým a tmavým motivem"
}
}, },
"dontHaveAccount": "", "dontHaveAccount": "",
"email": "", "email": "",
+4 -1
View File
@@ -1,7 +1,10 @@
{ {
"common": { "common": {
"appName": "Checkmate", "appName": "Checkmate",
"monitoringAgentName": "Capture" "monitoringAgentName": "Capture",
"buttons": {
"toggleTheme": ""
}
}, },
"dontHaveAccount": "Noch kein Konto", "dontHaveAccount": "Noch kein Konto",
"email": "E-Mail", "email": "E-Mail",
+4 -1
View File
@@ -1,7 +1,10 @@
{ {
"common": { "common": {
"appName": "Checkmate", "appName": "Checkmate",
"monitoringAgentName": "Capture" "monitoringAgentName": "Capture",
"buttons": {
"toggleTheme": "Toggles light & dark"
}
}, },
"dontHaveAccount": "Don't have account", "dontHaveAccount": "Don't have account",
"email": "E-mail", "email": "E-mail",
+4 -1
View File
@@ -1,7 +1,10 @@
{ {
"common": { "common": {
"appName": "Checkmate", "appName": "Checkmate",
"monitoringAgentName": "Capture" "monitoringAgentName": "Capture",
"buttons": {
"toggleTheme": ""
}
}, },
"dontHaveAccount": "No tengo una cuenta", "dontHaveAccount": "No tengo una cuenta",
"email": "Correo electronico", "email": "Correo electronico",
+4 -1
View File
@@ -1,7 +1,10 @@
{ {
"common": { "common": {
"appName": "Checkmate", "appName": "Checkmate",
"monitoringAgentName": "Capture" "monitoringAgentName": "Capture",
"buttons": {
"toggleTheme": ""
}
}, },
"dontHaveAccount": "Ei tiliä", "dontHaveAccount": "Ei tiliä",
"email": "Sähköposti", "email": "Sähköposti",
+4 -1
View File
@@ -1,7 +1,10 @@
{ {
"common": { "common": {
"appName": "Checkmate", "appName": "Checkmate",
"monitoringAgentName": "Capture" "monitoringAgentName": "Capture",
"buttons": {
"toggleTheme": ""
}
}, },
"dontHaveAccount": "Vous n'avez pas de compte", "dontHaveAccount": "Vous n'avez pas de compte",
"email": "E-mail", "email": "E-mail",
+4 -1
View File
@@ -1,7 +1,10 @@
{ {
"common": { "common": {
"appName": "Checkmate", "appName": "Checkmate",
"monitoringAgentName": "Capture" "monitoringAgentName": "Capture",
"buttons": {
"toggleTheme": ""
}
}, },
"dontHaveAccount": "Não tenho conta", "dontHaveAccount": "Não tenho conta",
"email": "E-mail", "email": "E-mail",
+4 -1
View File
@@ -1,7 +1,10 @@
{ {
"common": { "common": {
"appName": "Checkmate", "appName": "Checkmate",
"monitoringAgentName": "Capture" "monitoringAgentName": "Capture",
"buttons": {
"toggleTheme": ""
}
}, },
"dontHaveAccount": "Нет аккаунта", "dontHaveAccount": "Нет аккаунта",
"email": "Почта", "email": "Почта",
+4 -1
View File
@@ -1,7 +1,10 @@
{ {
"common": { "common": {
"appName": "Checkmate", "appName": "Checkmate",
"monitoringAgentName": "Capture" "monitoringAgentName": "Capture",
"buttons": {
"toggleTheme": ""
}
}, },
"dontHaveAccount": "Hesabınız yok mu", "dontHaveAccount": "Hesabınız yok mu",
"email": "E-posta", "email": "E-posta",
+4 -1
View File
@@ -1,7 +1,10 @@
{ {
"common": { "common": {
"appName": "Checkmate", "appName": "Checkmate",
"monitoringAgentName": "Capture" "monitoringAgentName": "Capture",
"buttons": {
"toggleTheme": ""
}
}, },
"dontHaveAccount": "沒有帳號", "dontHaveAccount": "沒有帳號",
"email": "E-mail", "email": "E-mail",