Bug 830782 - Homescreen is in English instead of Portuguese after flashed and Pt-BR is set in FTE. r=fabrice a=tef+

This commit is contained in:
Vivien Nicolas 2013-01-31 15:58:11 +01:00
parent 542718f50b
commit ac43005ec2

View File

@ -121,9 +121,17 @@ SettingsListener.observe('language.current', 'en-US', function(value) {
Ci.nsIPrefLocalizedString).data;
} catch(e) {}
// Bug 830782 - Homescreen is in English instead of selected locale after
// the first run experience.
// In order to ensure the current intl value is reflected on the child
// process let's always write a user value, even if this one match the
// current localized pref value.
if (!((new RegExp('^' + value + '[^a-z-_] *[,;]?', 'i')).test(intl))) {
Services.prefs.setCharPref(prefName, value + ', ' + intl);
value = value + ', ' + intl;
} else {
value = intl;
}
Services.prefs.setCharPref(prefName, value);
if (shell.hasStarted() == false) {
shell.start();