I have some two-letter country codes that I want to covert them into a country name with localised language, like US -> United States if the user is using English HK -> 香港 if the user is using Chinese etc Is there any way to do this?
Asked
Active
Viewed 649 times
1 Answers
0
You can look at this answer to get the system region. You can put the system languages in a dictionary to determine the country.
A caveat -- this method, as mentioned in the answer, returns the region, not necessarily the system language. Most of the time, they'll be the same, but if a user is multilingual, it might just take his region instead of all languages.