Browser country

Hi, I’m trying to get the user country using VaadinService.getCurrentRequest().getLocale().getCountry() but it shows an empty string. How can I obtain the current country of an user?

That’s technically not reliable possible. (Without external services)

I need for example of this information: en-US

Language and country. There is another way to obtain this result?

You could probably look at the Accept-Language Header and parse it

The Accept-Language Header can contains only language… but I really need of the region too

You can fiddle with js https://www.techighness.com/post/get-user-country-and-region-on-browser-with-javascript-only/

:wave: we use https://dev.maxmind.com/geoip/geolocate-an-ip/databases?lang=en#2-configure-a-geoip2-database-reader-to-query-the-database