зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1635561 - Use RegionalPrefLocales rather than AppLocale in xpc_LocalizeRuntime; r=zbraniecki
Differential Revision: https://phabricator.services.mozilla.com/D98390
This commit is contained in:
Родитель
961ecbeca0
Коммит
0b1722fcb7
|
@ -18,8 +18,7 @@ const localeService =
|
|||
Cc["@mozilla.org/intl/localeservice;1"].getService(Ci.mozILocaleService);
|
||||
const mozIntl = Cc["@mozilla.org/mozintl;1"].getService(Ci.mozIMozIntl);
|
||||
|
||||
let rpLocale = localeService.negotiateLanguages(localeService.regionalPrefsLocales,
|
||||
localeService.availableLocales)[0];
|
||||
let rpLocale = localeService.regionalPrefsLocales[0];
|
||||
|
||||
let testData = [
|
||||
{
|
||||
|
|
|
@ -133,11 +133,12 @@ bool xpc_LocalizeRuntime(JSRuntime* rt) {
|
|||
}
|
||||
|
||||
// No pref has been found, so get the default locale from the
|
||||
// application's locale.
|
||||
nsAutoCString appLocaleStr;
|
||||
LocaleService::GetInstance()->GetAppLocaleAsBCP47(appLocaleStr);
|
||||
// regional prefs locales.
|
||||
AutoTArray<nsCString, 10> rpLocales;
|
||||
LocaleService::GetInstance()->GetRegionalPrefsLocales(rpLocales);
|
||||
|
||||
return JS_SetDefaultLocale(rt, appLocaleStr.get());
|
||||
MOZ_ASSERT(rpLocales.Length() > 0);
|
||||
return JS_SetDefaultLocale(rt, rpLocales[0].get());
|
||||
}
|
||||
|
||||
void xpc_DelocalizeRuntime(JSRuntime* rt) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче