Hello, so I am trying to get the region/country of my users, this is not related to the language (Region) setting, but more so the actual Region setting on an OS.
For example in Windows, you can select your language and region, as in the, the language as it is spoken in that region, but you can also select your region, as seen in this screenshot here:
And this is where you can select the language (Region):
As I understand it, the language setting is not an accurate representation of where the user is located, and probably neither is the region one as it is only to provide localization info to the apps running on the OS, however it seems more of an accurate representation than the language one is.
I am trying 2 different methods to try and get the country code of the selected Region, but with no success.
I have tried this:
FInternationalization::Get().GetCurrentLocale()->GetRegion()
Which is giving me the Language region setting. In my case I have my language set to “English (Canada)” and my Region set to “Madagascar” but this gives me a result of “CA” for Canada.
And I have tried this:
FInternationalization::Get().GetCurrentCulture()->GetRegion()
Which is giving me a blank result, an empty string.
What is the difference between the two? And is there a known way to get the actual Region setting, not the Language Region?
My published app is currently operating on the first one, which gets the language region setting, but I want to change that to get the region setting.
For some of my users, I am seeing country code 419, which represents the Latin America region, this region is only an option in the language setting, as you can select Spanish (Latin America) but there is no Latin America setting for just the region, and I do want a more accurate country code, not a 419, so this is why I am looking to get the Region setting instead.
I understand there can be alternative options like prompting the user to select their location/region/country, or to use an IP geolocation service, but I want to avoid doing that if possible.