i18n: Fix theme toggle

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