diff --git a/examples/localization/src/app/(frontend)/[locale]/layout.tsx b/examples/localization/src/app/(frontend)/[locale]/layout.tsx index acff83dfd5..45e6bac213 100644 --- a/examples/localization/src/app/(frontend)/[locale]/layout.tsx +++ b/examples/localization/src/app/(frontend)/[locale]/layout.tsx @@ -20,6 +20,7 @@ import { getMessages, setRequestLocale } from 'next-intl/server' import { NextIntlClientProvider } from 'next-intl' import { routing } from '@/i18n/routing' import { notFound } from 'next/navigation' +import localization from '@/i18n/localization' type Args = { children: React.ReactNode @@ -30,6 +31,8 @@ type Args = { export default async function RootLayout({ children, params }: Args) { const { locale } = await params + const currentLocale = localization.locales.find((loc) => loc.code === locale) + const direction = currentLocale?.rtl ? 'rtl' : 'ltr' if (!routing.locales.includes(locale as any)) { notFound() @@ -43,6 +46,7 @@ export default async function RootLayout({ children, params }: Args) { diff --git a/examples/localization/src/globals/Header/Component.client.tsx b/examples/localization/src/globals/Header/Component.client.tsx index baed8743de..31b4f87694 100644 --- a/examples/localization/src/globals/Header/Component.client.tsx +++ b/examples/localization/src/globals/Header/Component.client.tsx @@ -45,7 +45,7 @@ export const HeaderClient: React.FC = ({ header }) => { className="container relative z-20 py-8 flex justify-end gap-2" {...(theme ? { 'data-theme': theme } : {})} > - +