congenialmobile/BazaarUtils — Issue #9: Bazaar forgets user preferred locale when the system locale is French.
Author: mehdi-behrooz
Created: 2011-11-12 15:45:09+00:00
State: open

When system locale is french and you select English as your preferred Bazaar language, each time that the application will be run, the language will be set to Persian.

After debugging, I found out that these things happen:

1. When user changes his/her preferred language to English, the "bzrLang" settings is correctly saved as "en" in Android SharedPreferences. (at: MultiLanguageApplication.handleSelectedMenuItem)

2. When the application starts each time, the "bzrLang" is loaded correctly from Android SharedPreferences with a value equal to "en" as should be. (at: MultiLanguageApplication.setLangForContextWrapper:119)

3. Next, it wants to create a java.util.Locale object based on the "en" value of "bzrLang". The code is: (at: MultiLanguageApplication.setLangForContextWrapper:123)

currentLocale = new Locale(bzrLang, systemLocale.getCountry())

which will be evaluated to this:

currentLocale = new Locale("en", "FR") // en_FR !!!

which is ridiculous, and SDK evaluates that as fr_FR.

4. The rest is obvious. there is no fr_FR language in Bazaar resources, so the default language which is apparently Persian is chosen.

--Mehdi