Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ export default withGTConfig(nextConfig);

Next.js serves the default locale without a prefix and prefixes the others. For example, English uses `/about` and French uses `/fr/about`.

Importing the values keeps both configurations in sync. If you hardcode `i18n.locales` or `i18n.defaultLocale` to values that differ from `gt.config.json`, `gt-next` prints a build-time warning that Next.js internationalized routing does not match the GT config file, because Next.js can then route to a locale that GT is not configured to translate. The comparison ignores ordering, so only the set of locales matters.

Keep each page at the root of `pages`; do not add a `[locale]` segment:

<Files>
Expand Down
2 changes: 1 addition & 1 deletion docs/en-US/react/nextjs-pages-router-quickstart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ const nextConfig: NextConfig = {
export default withGTConfig(nextConfig);
```

Next.js keeps the default locale at `/` and prefixes the other locales, such as `/es` and `/fr`. You do not need `gt-next` middleware or a `pages/[locale]` route segment. See [Pages Router locale routing](/docs/react/nextjs/pages-router-middleware) for detection and migration details.
Next.js keeps the default locale at `/` and prefixes the other locales, such as `/es` and `/fr`. You do not need `gt-next` middleware or a `pages/[locale]` route segment. Import the values from `gt.config.json` rather than repeating them, so the two configurations cannot drift; `gt-next` warns at build time when they disagree. See [Pages Router locale routing](/docs/react/nextjs/pages-router-middleware) for detection and migration details.


### 4. Add a load function for local translations
Expand Down
Loading