NextJS i18n国际化多国语言的处理

前端开发Next.js 468

推荐官方github中的示例

https://github.com/vercel/next.js/tree/canary/examples/i18n-routing

直接安装

npx create-next-app --example i18n-routing i18n-app
# or
yarn create next-app --example i18n-routing i18n-app
# or
pnpm create next-app --example i18n-routing i18n-app

此示例展示了如何使用 Next.jsi18n 路由功能创建国际化页面。它显示了一个普通页面、一个非动态getStaticProps页面、一个动态getStaticProps页面和一个getServerSideProps页面。

有关此功能的更多文档,请参阅国际化路由文档

相关资源:

Post Comment