Skip to content

Commit

Permalink
feat: Add setup file
Browse files Browse the repository at this point in the history
  • Loading branch information
codemod[bot] committed Jan 20, 2025
1 parent c7dd958 commit be2fdd0
Show file tree
Hide file tree
Showing 9 changed files with 14,780 additions and 11,919 deletions.
12 changes: 12 additions & 0 deletions apps/web/app/i18n/request.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { getRequestConfig } from "next-intl/server";

export default getRequestConfig(async () => {
// Provide a static locale, fetch a user setting,
// read from `cookies()`, `headers()`, etc.
const locale = "en";

return {
locale,
messages: (await import(`../messages/${locale}.json`)).default,
};
});
24 changes: 15 additions & 9 deletions apps/web/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,29 @@
import { geistMono, inter, satoshi } from "@/styles/fonts";
import "@/styles/globals.css";
import { cn, constructMetadata } from "@dub/utils";
import { NextIntlClientProvider } from "next-intl";
import { getMessages } from "next-intl/server";
import RootProviders from "./providers";

export const metadata = constructMetadata();

export default function RootLayout({
export default async function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
const messages = await getMessages();

return (
<html
lang="en"
className={cn(satoshi.variable, inter.variable, geistMono.variable)}
>
<body>
<RootProviders>{children}</RootProviders>
</body>
</html>
<NextIntlClientProvider messages={messages}>
<html
lang="en"
className={cn(satoshi.variable, inter.variable, geistMono.variable)}
>
<body>
<RootProviders>{children}</RootProviders>
</body>
</html>
</NextIntlClientProvider>
);
}
Loading

0 comments on commit be2fdd0

Please sign in to comment.