Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the proper locale code for Android for Simplified Chinese and Portugese-Brazil?

Tags:

android

locale

In my app users have the ability to switch their app locale to one of the other app supported languages. I'm having issues getting Portuguese-Brazil and Simplified Chinese to work. All other translations work properly when the user changes the locale settings.

These translations work properly if the device locale is pt-rBR or zh-rCN so the only thing that could be wrong is the locale code I use. However, anything I've tried fails. Anybody know the proper Android locale codes for these so users can properly switch if they desire?

like image 820
Jason Avatar asked Mar 25 '13 13:03

Jason


People also ask

What is Android default locale?

The default Locale is constructed statically at runtime for your application process from the system property settings, so it will represent the Locale selected on that device when the application was launched.

What is locale Android?

Locale represents a language/country/variant combination.

What is locale on phone?

Locales are used on Android to tailor the app to that specific region. Not only is it used for language selection but also other region-specific things like currency, temperature, date formatting, et cetera.


1 Answers

Use

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

instead of

new Locale("pt_BR");
like image 79
sourabh Avatar answered Sep 27 '22 02:09

sourabh