1

This is my next-i18next.config.js.

module.exports = {
  i18n: {
    defaultLocale: 'en',
    locales: ['ko', 'en', 'ja', 'zh'],
  },
  detection: {
    order: ['querystring', 'cookie', 'localStorage'],
    lookupQuerystring: 'lng',
  },
};

I want to detect locale from querystring. (www.example.com/detail?lang=en) But it does not work. next-i18next.config.js is already active in my project but app detect only with path(www.example.com/en/detail) What is missing for my config file?

use

  • next : 12.1.6
  • next-i18next : 12.0.0
  • react : 18.2.0
devohda
  • 11
  • 2
  • Isn't it just a typo? You've set `lookupQuerystring` to `lng` and you have `lang` in your example url – L. Letovanec Aug 24 '22 at 08:56
  • @L.Letovanec oh, yes. It's just a typo and it doesn't matter with my problem. – devohda Aug 24 '22 at 10:14
  • 1
    if you use i18n functionality of next.js you can’t create your own detection. Here an alternative: https://locize.com/blog/next-i18n-static/ -> https://github.com/i18next/next-i18next/tree/master/examples/ssg – adrai Aug 24 '22 at 19:34

0 Answers0