Is there a way for Nextjs to automatically detect the user's country based on the cookies from Cloudflare and incorporate it into the URL? We want to personalize our site for specific countries without manually listing them all out in different languages. Nextjs docs suggest the following configuration:
i18n: {
locales: ['en-US', 'fr', 'nl-NL'],
defaultLocale: 'en-US',
}
I would prefer not to manually specify all countries in both English and Arabic. Is there a method to dynamically detect the country and adjust the URL accordingly? Or should we only list the countries we are interested in and have a default for the rest of the world? I don't want to create separate common.json files for each country, such as en-US and en-UK. I would like them to be subdirectories in the URL but still read from en/common.json.