Commit c869eb63 authored by henry's avatar henry Committed by Pier Angelo Vendrame
Browse files

fixup! BB 41930: Remove the UI to customize accept_languages.

BB 44793: Use settings config for spoof english checkbox.
parent 5eb34fb8
Loading
Loading
Loading
Loading
+21 −0
Original line number Diff line number Diff line
@@ -658,9 +658,22 @@ Preferences.addSetting({
  },
});

Preferences.addSetting({
  id: "websiteSpoofEnglish",
  pref: "privacy.spoof_english",
  get: val => {
    return val == 2;
  },
  set: val => {
    return val ? 2 : 1;
  },
});

Preferences.addSetting({
  id: "websiteLanguageWrapper",
  deps: ["acceptLanguages"],
  // Hide website language settings. tor-browser#41930.
  visible: () => false,
  onUserReorder(event, deps) {
    const { draggedIndex, targetIndex } = event.detail;

@@ -932,6 +945,14 @@ SettingGroupManager.registerGroups({
      },
    ],
  },
  websiteSpoofEnglish: {
    items: [
      {
        id: "websiteSpoofEnglish",
        l10nId: "languages-customize-spoof-english",
      },
    ],
  },
  translations: {
    inProgress: true,
    l10nId: "settings-translations-header",
+3 −2
Original line number Diff line number Diff line
@@ -99,9 +99,10 @@
              languages-customize-add.label,
            " />
    -->
    <checkbox id="spoofEnglish"
              data-l10n-id="languages-customize-spoof-english"/>
  </hbox>
  <!-- TODO: Integrate into the "Languages" setting-group after bugzilla bug
     - 1972081. -->
  <html:setting-group groupid="websiteSpoofEnglish"></html:setting-group>

  <checkbox id="useSystemLocale" hidden="true"
            data-l10n-id="use-system-locale"
+1 −16
Original line number Diff line number Diff line
@@ -784,6 +784,7 @@ var gMainPane = {
    initSettingGroup("fonts");
    initSettingGroup("browserLanguage");
    initSettingGroup("websiteLanguage");
    initSettingGroup("websiteSpoofEnglish");
    initSettingGroup("browsing");
    initSettingGroup("keyboardAndScrolling");
    initSettingGroup("motionAndLink");
@@ -803,22 +804,6 @@ var gMainPane = {
    });

    // setEventListener("chooseLanguage", "command", gMainPane.showLanguages);
    {
      const spoofEnglish = document.getElementById("spoofEnglish");
      const kPrefSpoofEnglish = "privacy.spoof_english";
      const preference = Preferences.add({
        id: kPrefSpoofEnglish,
        type: "int",
      });
      const spoofEnglishChanged = () => {
        spoofEnglish.checked = preference.value == 2;
      };
      spoofEnglishChanged();
      preference.on("change", spoofEnglishChanged);
      setEventListener("spoofEnglish", "command", () => {
        preference.value = spoofEnglish.checked ? 2 : 1;
      });
    }

    // Initilize Application section.