File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import compiler from '@replexica/compiler' ;
22
3- console . log ( compiler ) ;
4-
53/** @type {import('next').NextConfig } */
64const nextConfig = { } ;
75
Original file line number Diff line number Diff line change 1+ 'use client' ;
2+
3+ export default function ClientContent ( ) {
4+ return (
5+ < div >
6+ Hello world!
7+ </ div >
8+ ) ;
9+ }
Original file line number Diff line number Diff line change 1+ import ClientContent from "./content" ;
2+
3+ export default ClientContent ;
Original file line number Diff line number Diff line change 11import type { Metadata } from "next" ;
22import { Inter } from "next/font/google" ;
3+ import { ReplexicaIntlProvider } from '@replexica/react/client' ;
4+ import { loadLocaleFromCookie } from '@replexica/react/next' ;
35import "./globals.css" ;
46
57const inter = Inter ( { subsets : [ "latin" ] } ) ;
@@ -9,14 +11,18 @@ export const metadata: Metadata = {
911 description : "Generated by create next app" ,
1012} ;
1113
12- export default function RootLayout ( {
14+ export default async function RootLayout ( {
1315 children,
1416} : Readonly < {
1517 children : React . ReactNode ;
1618} > ) {
19+ const locale = await loadLocaleFromCookie ( ) ;
20+ const localeData = await import ( `@replexica/output/${ locale } .json` ) . then ( ( m ) => m . default ) ;
1721 return (
18- < html lang = "en" >
19- < body className = { inter . className } > { children } </ body >
20- </ html >
22+ < ReplexicaIntlProvider data = { localeData } >
23+ < html lang = { locale } >
24+ < body className = { inter . className } > { children } </ body >
25+ </ html >
26+ </ ReplexicaIntlProvider >
2127 ) ;
2228}
You can’t perform that action at this time.
0 commit comments