зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1379910 - Add Preference option to change the locale strategy for regional preferences r=fluent-reviewers,jaws,flod CLOSED TREE
Differential Revision: https://phabricator.services.mozilla.com/D69715
This commit is contained in:
Родитель
62d94d25d6
Коммит
c05f5f1c5a
|
@ -752,6 +752,8 @@ pref("browser.download.hide_plugins_without_extensions", true);
|
|||
pref("browser.backspace_action", 0);
|
||||
#endif
|
||||
|
||||
pref("intl.regional_prefs.use_os_locales", false);
|
||||
|
||||
// this will automatically enable inline spellchecking (if it is available) for
|
||||
// editable elements in HTML
|
||||
// 0 = spellcheck nothing
|
||||
|
@ -1198,6 +1200,7 @@ pref("services.sync.prefs.sync.dom.event.contextmenu.enabled", true);
|
|||
pref("services.sync.prefs.sync.extensions.update.enabled", true);
|
||||
pref("services.sync.prefs.sync.extensions.activeThemeID", true);
|
||||
pref("services.sync.prefs.sync.intl.accept_languages", true);
|
||||
pref("services.sync.prefs.sync.intl.regional_prefs.use_os_locales", true);
|
||||
pref("services.sync.prefs.sync.layout.spellcheckDefault", true);
|
||||
pref("services.sync.prefs.sync.media.autoplay.default", true);
|
||||
pref("services.sync.prefs.sync.media.eme.enabled", true);
|
||||
|
|
|
@ -326,6 +326,11 @@
|
|||
</hbox>
|
||||
</hbox>
|
||||
|
||||
<checkbox id="useSystemLocale" hidden="true"
|
||||
data-l10n-id="use-system-locale"
|
||||
data-l10n-args='{"localeName": "und"}'
|
||||
preference="intl.regional_prefs.use_os_locales"/>
|
||||
|
||||
<hbox id="translationBox" hidden="true">
|
||||
<hbox align="center" flex="1">
|
||||
<checkbox id="translate" preference="browser.translation.detectLanguage"
|
||||
|
|
|
@ -147,6 +147,7 @@ Preferences.addAll([
|
|||
|
||||
// Languages
|
||||
{ id: "browser.translation.detectLanguage", type: "bool" },
|
||||
{ id: "intl.regional_prefs.use_os_locales", type: "bool" },
|
||||
|
||||
// General tab
|
||||
|
||||
|
@ -359,7 +360,7 @@ var gMainPane = {
|
|||
this.updatePerformanceSettingsBox({ duringChangeEvent: true });
|
||||
});
|
||||
this.updatePerformanceSettingsBox({ duringChangeEvent: false });
|
||||
|
||||
this.displayUseSystemLocale();
|
||||
let connectionSettingsLink = document.getElementById(
|
||||
"connectionSettingsLearnMore"
|
||||
);
|
||||
|
@ -1369,6 +1370,29 @@ var gMainPane = {
|
|||
gMainPane.hideConfirmLanguageChangeMessageBar();
|
||||
},
|
||||
|
||||
displayUseSystemLocale() {
|
||||
let appLocale = Services.locale.appLocaleAsBCP47;
|
||||
let regionalPrefsLocales = Services.locale.regionalPrefsLocales;
|
||||
if (!regionalPrefsLocales.length) {
|
||||
return;
|
||||
}
|
||||
let systemLocale = regionalPrefsLocales[0];
|
||||
let localeDisplayname = Services.intl.getLocaleDisplayNames(undefined, [
|
||||
systemLocale,
|
||||
]);
|
||||
if (!localeDisplayname.length) {
|
||||
return;
|
||||
}
|
||||
let localeName = localeDisplayname[0];
|
||||
if (appLocale.split("-u-")[0] != systemLocale.split("-u-")[0]) {
|
||||
let checkbox = document.getElementById("useSystemLocale");
|
||||
document.l10n.setAttributes(checkbox, "use-system-locale", {
|
||||
localeName,
|
||||
});
|
||||
checkbox.hidden = false;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Displays the translation exceptions dialog where specific site and language
|
||||
* translation preferences can be set.
|
||||
|
|
|
@ -285,6 +285,11 @@ translate-exceptions =
|
|||
.label = Exceptions…
|
||||
.accesskey = x
|
||||
|
||||
# Variables:
|
||||
# $localeName (string) - Localized name of the locale to be used.
|
||||
use-system-locale =
|
||||
.label = Use your operating system settings for “{ $localeName }” to format dates, times, numbers, and measurements.
|
||||
|
||||
check-user-spelling =
|
||||
.label = Check your spelling as you type
|
||||
.accesskey = t
|
||||
|
|
Загрузка…
Ссылка в новой задаче