fre*_*erk 5 localization routes internationalization reactjs next.js
我正在尝试根据当前子域翻译我的下一个应用程序。例如,我想en.hello.com
用英语,并it.hello.com
用意大利语。
我正在尝试使用 Next 的域路由来实现这一点,但显然,这并不意味着与子域一起使用,而是与顶级域一起使用,例如英语和意大利语的hello.en
和。hello.it
这是我的next.config.js:
module.exports = {
i18n: {
locales: ["en", "it"],
defaultLocale: "en",
domains: [
{
domain: "en.hello.com",
defaultLocale: "en",
},
{
domain: "it.hello.com",
defaultLocale: "it",
},
],
},
};
Run Code Online (Sandbox Code Playgroud)
这些设置无法映射en.hello.com
到英语和it.hello.com
意大利语。
谁能解释一下为什么会这样以及如何在 Next 中实现子域路由?
归档时间: |
|
查看次数: |
4492 次 |
最近记录: |