From 1d689251985cb39c88b791946ea7881e5bc53a4c Mon Sep 17 00:00:00 2001 From: "Dennis (via Claude+Gemma)" Date: Sat, 23 May 2026 06:17:36 +0200 Subject: [PATCH] feat(language-toggle): i18n-Stub mit DE/EN-Toggle (localStorage) [tsc:fail] --- .phase10-state.json | 5 ++- GENERATION_LOG.md | 19 +++++++++ apps/web/src/components/Nav.tsx | 24 +++++++++-- apps/web/src/lib/i18n.tsx | 73 +++++++++++++++++++++++++++++++++ 4 files changed, 116 insertions(+), 5 deletions(-) create mode 100644 apps/web/src/lib/i18n.tsx diff --git a/.phase10-state.json b/.phase10-state.json index 8e24fcc..84ea963 100644 --- a/.phase10-state.json +++ b/.phase10-state.json @@ -1,9 +1,10 @@ { "completed_features": [], - "current_feature": "project-templates", + "current_feature": "language-toggle", "started_at": "2026-05-23T06:10:51.530595", "attempted_features": [ "markdown-notes-time-entry", - "customer-tags" + "customer-tags", + "project-templates" ] } \ No newline at end of file diff --git a/GENERATION_LOG.md b/GENERATION_LOG.md index 5c283a3..95e0eee 100644 --- a/GENERATION_LOG.md +++ b/GENERATION_LOG.md @@ -1210,3 +1210,22 @@ src/index.ts(27,25): error TS2769: No overload matches this call. Overload 2 of 3, '(plugin: FastifyPluginAsync<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>, opts?: FastifyRegisterOptions<...> | undefined): FastifyInstance<...> & PromiseLike<...>', gave the following error. Argument of type 'Promise' is not assignable to parameter of type 'FastifyPluginAsync<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>'. Type 'Promise' provides no match for the signature '(instance: FastifyInstance, FastifyBaseLogger, FastifyTy +- `06:16:21` **INFO** Committed feature project-templates +- `06:16:21` **INFO** Pushed: rc=0 + +## Phase-3 Feature: language-toggle (2026-05-23 06:16:21) + +- `06:16:21` **INFO** Description: i18n-Stub mit DE/EN-Toggle (localStorage) +- `06:16:21` **INFO** Generating apps/web/src/lib/i18n.tsx (Mini-i18n. useTranslation()-Hook: returns {t, setLang, lang}. Dictiona…) +- `06:16:43` **INFO** wrote 2201 chars in 21.5s (attempt 1) +- `06:16:43` **INFO** Generating apps/web/src/components/Nav.tsx (ERWEITERT — füge Sprach-Toggle (DE/EN Button) rechts neben Theme-Toggl…) +- `06:17:35` **INFO** wrote 5421 chars in 51.9s (attempt 1) +- `06:17:35` **INFO** Running tsc --noEmit on api… +- `06:17:36` **WARN** tsc errors: +src/index.ts(27,25): error TS2769: No overload matches this call. + Overload 1 of 3, '(plugin: FastifyPluginCallback<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>, opts?: FastifyRegisterOptions<...> | undefined): FastifyInstance<...> & PromiseLike<...>', gave the following error. + Argument of type 'Promise' is not assignable to parameter of type 'FastifyPluginCallback<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>'. + Type 'Promise' provides no match for the signature '(instance: FastifyInstance, FastifyBaseLogger, FastifyTypeProvider>, opts: { ...; }, done: (err?: Error | undefined) => void): void'. + Overload 2 of 3, '(plugin: FastifyPluginAsync<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>, opts?: FastifyRegisterOptions<...> | undefined): FastifyInstance<...> & PromiseLike<...>', gave the following error. + Argument of type 'Promise' is not assignable to parameter of type 'FastifyPluginAsync<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>'. + Type 'Promise' provides no match for the signature '(instance: FastifyInstance, FastifyBaseLogger, FastifyTy diff --git a/apps/web/src/components/Nav.tsx b/apps/web/src/components/Nav.tsx index ca6fbb6..a264243 100644 --- a/apps/web/src/components/Nav.tsx +++ b/apps/web/src/components/Nav.tsx @@ -14,7 +14,8 @@ import { Menu, X, Zap, - CreditCard + CreditCard, + Languages } from "lucide-react" import { useQuery } from "@tanstack/react-query" import { api } from "../lib/api" @@ -24,6 +25,7 @@ export default function Nav() { const location = useLocation() const { theme, toggleTheme } = useTheme() const [isMobileMenuOpen, setIsMobileMenuOpen] = useState(false) + const [lang, setLang] = useState<'en' | 'de'>('en') const { data: user } = useQuery({ queryKey: ['me'], @@ -98,9 +100,25 @@ export default function Nav() { + +
+ + +