2

I have been trying to use the NextJs i18n routing on a website Archive, but when I followed the exact steps provided in the documentation, I got this error: Incorrect locale information provided

I tried to debug it by checking the headers of the requests but it's all correct.

I tried to solve this by checking the error on console, reading related questions on stackoverflow Archive and GitHub Archive but without success.

a0m0rajab
  • 115
  • 7

1 Answers1

1

The issue is happening due to getting the language array as: [ "*" ] Which is not defined in the language that we have, I added an if condition to solve this issue:

    if (languages.length === 1 && languages[0] === '*') {
        languages = ['ar']
    }

Then followed the same steps in the documentation and it worked well.

a0m0rajab
  • 115
  • 7