From c27c36f13421c109abcd45488cb4e1a4468bccca Mon Sep 17 00:00:00 2001 From: Mathis Burger Date: Thu, 7 Nov 2024 22:20:28 +0100 Subject: [PATCH 01/14] feat: Added translations for landing page --- web/app/layout.tsx | 47 +++++---- web/app/page.tsx | 14 +-- web/i18n.ts | 27 +++++ web/package-lock.json | 125 ++++++++++++++++++++++++ web/package.json | 4 + web/public/locales/de/landing-page.json | 15 +++ web/public/locales/en/landing-page.json | 15 +++ 7 files changed, 221 insertions(+), 26 deletions(-) create mode 100644 web/i18n.ts create mode 100644 web/public/locales/de/landing-page.json create mode 100644 web/public/locales/en/landing-page.json diff --git a/web/app/layout.tsx b/web/app/layout.tsx index df0af089..b6ad5fc0 100644 --- a/web/app/layout.tsx +++ b/web/app/layout.tsx @@ -21,6 +21,8 @@ import Footer from "@/components/Footer"; import { publicRoutes } from "@/static/routes"; import Stage2SpotlightContextWrapper from "@/components/spotlight/Stage2SpotlightContextWrapper"; import {Stage2Type} from "@/hooks/spotlight/stage2"; +import i18n from "../i18n" +import CentralLoading from "@/components/CentralLoading"; export default function RootLayout({ children, @@ -28,6 +30,7 @@ export default function RootLayout({ children: React.ReactNode; }>) { const [user, setUser] = useState(null); + const [loading, setLoading] = useState(true); const pathname = usePathname(); const showNavbar = useMemo( () => publicRoutes.indexOf(pathname) === -1, @@ -51,6 +54,8 @@ export default function RootLayout({ console.error(e); } } + i18n.init(); + setLoading(false); }, []); return ( @@ -67,25 +72,29 @@ export default function RootLayout({ - - - - -
- - {showNavbar && ( - - - - )} - {children} -