[dyad] Added language switcher for English and German - wrote 10 file(s), renamed 2 file(s), added next-intl package(s)

This commit is contained in:
[dyad]
2026-01-18 12:39:47 +01:00
parent 1d41f871ee
commit 2136a2dd79
11 changed files with 799 additions and 118 deletions

View File

@@ -1,44 +1,17 @@
import type { Metadata } from "next";
import { Geist, Geist_Mono } from "next/font/google";
import "./globals.css";
import { ThemeProvider } from "@/components/theme-provider";
import { Toaster } from "@/components/ui/sonner";
import { ReactNode } from 'react';
const geistSans = Geist({
variable: "--font-geist-sans",
subsets: ["latin"],
});
const geistMono = Geist_Mono({
variable: "--font-geist-mono",
subsets: ["latin"],
});
export const metadata: Metadata = {
title: "Image Web Exporter",
description: "Upload a picture, then export it in a different resolution and format.",
type Props = {
children: ReactNode;
params: { locale: string };
};
export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
// Even though this component is just passing its children through, the presence
// of this file fixes an issue in Next.js 13.4 where link clicks that switch
// the locale would otherwise cause a full page reload.
export default function RootLayout({ children, params: { locale } }: Props) {
return (
<html lang="en" suppressHydrationWarning>
<body
className={`${geistSans.variable} ${geistMono.variable} antialiased`}
>
<ThemeProvider
attribute="class"
defaultTheme="system"
enableSystem
disableTransitionOnChange
>
{children}
<Toaster />
</ThemeProvider>
</body>
<html lang={locale}>
<body>{children}</body>
</html>
);
}