martinkr/next-export-i18n

How can next-export-i18n detect language based on domain?

NguyenChiTrung1310 opened this issue · 1 comments

How can I detect browser language based on a specific domain url ? Something likes this:

module.exports = {
  i18n: {
    localeDetection: false,
    locales: ['en', 'ja', 'vi'],
    defaultLocale: 'en',
    localePath: './locales',
    domains: [
      {
        domain: 'website.net',
        defaultLocale: 'en',
        http: true
      },
      {
        domain: 'website.jp',
        defaultLocale: 'ja',
        http: true
      }
    ]
  }
}

Please support me to resolve this. Thank you for your help

Hi @NguyenChiTrung1310 ,

Thank you for reaching out.

This functionality is not supported by the package.
It provides client side i18n for exported static pages. If you need a multi domain setup, you would export each domain individually, set the default locale and map the domain to different folders. All of this should be part of your build scripts.

Cheers!