3

If the device chooses French as the language, will the locale automatically set to French as well? Or does it depend on user's current location?

For iOS, language and region are separate settings while in Android, seems like we only get to choose Language but not the region.

Comparison: Android - Chooses French language, locale becomes fr-FR iOS - Chooses English language, French region, locale becomes en-FR

For Android is there any other way to retrieve device's region?

I have been Googling around but couldn't find a good source of information on this topic yet.

Bruce
  • 2,357
  • 5
  • 29
  • 50

1 Answers1

0

In Android you can select Portuguese (Portugal) or Portuguese (Brasil) which translates to pt-PT and pt-BR. In this case there are two different languages, which I personally find it redundant, because the better way of handling this would be to separate languages and regions.

However you can programmatically change the language and region, by setting:

new Locale("pt", "PT");

You can read more about programmatically changing the language here:

fphilipe
  • 9,739
  • 1
  • 40
  • 52
box
  • 4,450
  • 2
  • 38
  • 38