I need to find the language based on country code.
For country code "US", it should return "en" or "CN" should return "zh". I went through java.util.Locale
, it works on LanguageCode rather than countryCode. Also, Locale.getAvailableLocales
is not helpful here, as it returns multiple languages for same countryCode. Is there anything else that can be useful. I want to avoid initialising all useful locale in a file and then using it. (as it may require update regularly whenever we have to use a new Locale)
Thanks in advance
Looked into other stackoverflow questions, could not find answers thus posting a new question here.