3

我已经next-i18next在几个项目中使用包并且效果很好。

react-i18next在我当前的项目中,我需要集成 i18n,但这次只支持 cookie,没有国际化路由,我想知道我是否可以通过这个包实现这一点,或者我应该回到i18next

样本:

// No cookie or EN cookie
https://app.example.com shows EN version

// Cookie `next-i18n-lang` set to specific language (IT, DE, etc)
https://app.example.com shows translated version

我认为我们不能next/router locale开箱即用,但这作为集成的缺点是可以接受的。

4

1 回答 1

1

您可以通过将 localeDetection 设置为 false 来禁用该功能。

    // next.config.js
          module.exports = {
      i18n: {
        localeDetection: false,
      },
    }

https://nextjs.org/docs/advanced-features/i18n-routing#disabling-automatic-locale-detection

于 2022-02-22T03:21:39.440 回答