I'm trying to get the country language of the user, not the selected one on the phone. For example: I'm building an English learning app, but in my phone I've set language to English for learning purposes, and it doesn't translate because it thinks that my language is English, but I live in brazil, I want it to find that my language is Portuguese. to get languages by especific location. I have tried some codes, but not seems to work. I have many users in my app that have English language on phone, so they are facing the same problem.
var currentLanguage: String = Locale.getDefault().language
var language = this.getResources().getConfiguration().getLocales().get(0).language
They both give me the same value, that my language is english, and if I get the country it says I'm in US.
EDIT: I'm able to get the country code with it:
var tm = this.getSystemService(TELEPHONY_SERVICE) as TelephonyManager
var countryCodeValue = tm.networkCountryIso
It returns br, but how can I get the language from this tag? There is something like: countryCodeValue.language ?