# General Translation Changelog: gt-next 11.1.3: Pages Router 原生区域设置路由
URL: https://generaltranslation.com/zh/blog/gt-next_v11_1_3.mdx
Docs index: https://generaltranslation.com/llms.txt
Description: 
Authors: Ernest McCarter
Published: 2026-07-29

## 概览

`gt-next` v11.1.3 在 Pages Router 应用中使用 Next.js 的国际化路由。Next.js 现在负责处理带区域设置前缀的 URL、请求区域设置上下文、浏览器检测和客户端导航，而 `gt-next` 则加载相应的翻译快照。有关完整设置，请参阅更新后的 [Next.js Pages Router Quickstart](/docs/react/nextjs-pages-router-quickstart)。

## 配置 Pages Router 的区域设置

将 `gt.config.json` 中使用的区域设置同步到 `next.config.ts`：

```ts title="next.config.ts"
import type { NextConfig } from 'next';
import { withGTConfig } from 'gt-next/config';
import gtConfig from './gt.config.json';

const nextConfig: NextConfig = {
  i18n: {
    locales: gtConfig.locales,
    defaultLocale: gtConfig.defaultLocale,
  },
};

export default withGTConfig(nextConfig);
```

`locales` 数组必须包含 `defaultLocale`。页面仍直接置于 `pages` 目录下；`pages/[locale]` 路径段和 `gt-next` 中间件不再属于推荐的 Pages Router 配置。

[`withGTServerSideProps`](/docs/react/nextjs-pages-router-quickstart) 和 [`withGTStaticProps`](/docs/react/nextjs/pages-router-static-site-generation) 会从 Next.js 数据函数的上下文中读取区域设置。区域设置的选择通过支持区域设置的 Pages Router 导航和 `NEXT_LOCALE` 偏好 cookie 实现。

## Sitemap

See the full [sitemap](https://generaltranslation.com/sitemap.md) for all pages.
