feat: add Polish and English language switcher

This commit is contained in:
zv
2026-06-01 18:54:08 +02:00
parent 840555f4f5
commit 6c2e731c60
29 changed files with 531 additions and 143 deletions

View File

@@ -3,10 +3,12 @@
import { useEffect, useState } from "react";
import { Moon, Sun, SunMoon } from "lucide-react";
import { Button } from "@/components/ui/button";
import { useI18n } from "@/lib/i18n";
export function ThemeToggle() {
const [mounted, setMounted] = useState(false);
const [isDark, setIsDark] = useState(false);
const { t } = useI18n();
useEffect(() => {
const root = document.documentElement;
@@ -39,7 +41,7 @@ export function ThemeToggle() {
<Button
variant="icon"
type="button"
aria-label={!mounted ? "Zmień motyw" : isDark ? "Włącz jasny motyw" : "Włącz ciemny motyw"}
aria-label={!mounted ? t("theme.change") : isDark ? t("theme.light") : t("theme.dark")}
onClick={toggleTheme}
>
{!mounted ? <SunMoon className="size-4" /> : isDark ? <Sun className="size-4" /> : <Moon className="size-4" />}