i18nexus / next-i18n-router

Next.js App Router internationalized routing and locale detection.
MIT License
260 stars 18 forks source link

[Feature] - Handle domains #71

Open Metarock opened 6 months ago

Metarock commented 6 months ago

I'm currently trying out next-i18n-router with react-i18next. Loving it so far and implementation is straight forward. However, I can't get my head around on how to handle domains. For example the library next-intl, has a domain configuration (an example of the code snippet):

export default createMiddleware({
  locales,
  defaultLocale: 'en',
  localePrefix: 'never',
  localeDetection: false,
  domains: [
    {
      domain: process.env.PT_DOMAIN!,
      defaultLocale: 'pt',
      locales: ['pt'],
    },
    {
      domain: process.env.ES_DOMAIN!,
      defaultLocale: 'es',
      locales: ['es'],
    },
  ],
});

I was wondering if next-i18n-router is able to support this feature. Please kindly advise. Thank you

i18nexus commented 6 months ago

Hi there! Yes, this has been on our to do list. I think we've only had one request for it back when we first created this library, so it hasn't been a priority. But yes, I think it's a necessary and expected feature. We'll start investigating this week and try to get something out soon. We'll use this issue to track progress.

luluhoc commented 5 months ago

This is much needed! @i18nexus

klonwar commented 4 months ago

+1 on this

SantiagoLuesma commented 2 months ago

This is much needed! @i18nexus