You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is my layout file in src/app/[locale] folder :
importtype{Metadata}from"next";import"@/styles/global.css";importNavigationfrom"@/components/common/navigation/Navigation";importFooterfrom"@/components/common/footer/Footer";import{Inter}from"next/font/google";importReactfrom"react";import{NextIntlClientProvider}from'next-intl';import{getMessages}from'next-intl/server';import{notFound}from'next/navigation';import{routing}from'@/languages/i18n/routing';constinter=Inter({subsets: ["latin"]});exportconstmetadata: Metadata={title: "Create Next App",description: "Generated by signup next (app)",};exportdefaultasyncfunctionRootLayout({
children,
params
}: {children: React.ReactNode;params: Promise<{locale: string}>;}){constlocale=(awaitparams).localeif(!routing.locales.includes(localeasany))notFound();constmessages=awaitgetMessages();return(<htmllang={locale}suppressHydrationWarning><bodyclassName={inter.className}><NextIntlClientProvidermessages={messages}><Navigation/>{
children
}<Footer/></NextIntlClientProvider></body></html>);}
For some reason, the data changes only when the default locale section in the routing file is changed, otherwise the data does not change when the language code is specified in the url section.
Verifications
I've verified that the problem I'm experiencing isn't covered in the docs.
@amannn Isn't there a way to define a path for this because as far as I know, the middleware file in next.js projects is generally not located under the src folder ?
The middleware file is usually defined under the root directory.
Description
I have constantly reviewed my code, visited various sites, looked at the documentation, but it only works without i18n routing.
This is my next.config.ts file :
This is my middleware.ts file :
This my request.ts file in i18n folder :
This my routing.ts file in i18n folder :
This is my layout file in src/app/[locale] folder :
For some reason, the data changes only when the default locale section in the routing file is changed, otherwise the data does not change when the language code is specified in the url section.
Verifications
Mandatory reproduction URL
https://github.com/rznkolds/test.git
Reproduction description
Steps to reproduce:
Expected behaviour
When the language code in the URL section changes, the page language must also change.
The text was updated successfully, but these errors were encountered: