Skip to content

Conversation

@longsizhuo
Copy link
Member

Summary

  • add i18n.ts with supported locales
  • configure Next.js to use next-intl
  • install next-intl dependency

Testing

  • pnpm build (fails: stuck while exporting pages)

https://chatgpt.com/codex/tasks/task_e_68c7012be00083238ad1872e3655e9cc

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codex Review: Here are some suggestions.

Reply with @codex fix comments to fix any unresolved comments.

About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you open a pull request for review, mark a draft as ready, or comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex fix this CI failure" or "@codex address that feedback".

Comment on lines 12 to +15
images: { unoptimized: true }, // 避免使用 Next Image 优化服务
};

export default withMDX(config);
export default withNextIntl(withMDX(config));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] Enable next-intl plugin without locale-aware routes

Wrapping the Next.js config with createNextIntlPlugin('./i18n.ts') configures the app to rewrite requests to locale-prefixed paths (e.g. /en, /zh). The current app directory only contains root-level routes (app/page.tsx, app/docs/...) and does not provide a [locale] segment or locale-aware layouts. After this change, users will be redirected to locale-prefixed URLs that have no matching pages, leading to 404s for every request. The locale directory structure and layouts need to be added before enabling the plugin.

Useful? React with 👍 / 👎.

@longsizhuo longsizhuo merged commit 6d3f78f into main Sep 14, 2025
1 check passed
@longsizhuo longsizhuo deleted the codex/set-up-internationalization-with-next-intl branch September 17, 2025 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants