João Diogo Ferreira devilj@outlook.pt wrote:
How about returning something like GetLocaleInfo(GetUserDefaultLCID(), LOCALE_ICOUNTRY|LOCALE_RETURN_NUMBER)?
LOCALE_ICOUNTRY is the phone prefix, but your idea is sound. I tried LOCALE_IGEOID too but couldn't figure out how to implement in Wine. (Hint: simply adding those to the .nls files was not enough.)
Using LOCALE_IGEOID looks appropriate, it would be nice to follow this route.
What I found works is asking for the country code (LOCALE_SISO3166CTRYNAME) (what a mouthful) and matching it to the GeoID (easy).
Working with letter codes is actually better, too, because Microsoft is moving away from GeoIDs and into "geonames" (two-letter codes, like Linux and Android) and we can just do the matching in the new procs that support geonames. In fact, that's exactly what Microsoft is doing! Useful behavior to replicate.
Now, what I really, really need to know is how to let anybody opt-out, because not every country has a locale in Linux (or Wine, for that matter) x.x
Just don't worry about it for the initial implementation until that becomes a real problem (which is unlikely, since the missing locale support in the host OS would be the first thing to take care about).