From c18ddeaa00c99d739e02f5870043e89135e74270 Mon Sep 17 00:00:00 2001 From: Greg Tatum Date: Fri, 23 Jun 2023 13:36:13 +0000 Subject: [PATCH] Bug 1817084 - Remove old translations code; r=settings-reviewers,fluent-reviewers,nordzilla,mconley,flod Differential Revision: https://phabricator.services.mozilla.com/D181700 --- browser/app/profile/firefox.js | 15 +- browser/base/content/browser.js | 1 - .../static/browser_all_files_referenced.js | 10 - browser/components/BrowserGlue.sys.mjs | 16 - browser/components/moz.build | 1 - browser/components/preferences/main.inc.xhtml | 20 +- browser/components/preferences/main.js | 41 -- .../components/translation/BingTranslator.jsm | 488 ------------- .../translation/GoogleTranslator.jsm | 306 -------- .../translation/TranslationChild.jsm | 163 ----- .../translation/TranslationDocument.jsm | 679 ------------------ .../translation/TranslationParent.jsm | 455 ------------ .../translation/YandexTranslator.jsm | 357 --------- .../translation/content/.eslintrc.js | 13 - browser/components/translation/content/jar.mn | 5 - .../microsoft-translator-attribution.png | Bin 2220 -> 0 bytes .../components/translation/content/moz.build | 7 - browser/components/translation/moz.build | 21 - browser/components/translation/test/bing.sjs | 250 ------- .../components/translation/test/browser.ini | 13 - .../test/browser_translation_bing.js | 160 ----- .../test/browser_translation_exceptions.js | 239 ------ .../test/browser_translation_yandex.js | 134 ---- .../test/browser_translations_settings.js | 384 ---------- .../test/fixtures/bug1022725-fr.html | 15 - .../test/fixtures/result-da39a3ee5e.txt | 22 - .../fixtures/result-yandex-d448894848.json | 8 - .../components/translation/test/yandex.sjs | 203 ------ .../en-US/browser/preferences/preferences.ftl | 8 - .../themes/shared/preferences/preferences.css | 5 - 30 files changed, 4 insertions(+), 4035 deletions(-) delete mode 100644 browser/components/translation/BingTranslator.jsm delete mode 100644 browser/components/translation/GoogleTranslator.jsm delete mode 100644 browser/components/translation/TranslationChild.jsm delete mode 100644 browser/components/translation/TranslationDocument.jsm delete mode 100644 browser/components/translation/TranslationParent.jsm delete mode 100644 browser/components/translation/YandexTranslator.jsm delete mode 100644 browser/components/translation/content/.eslintrc.js delete mode 100644 browser/components/translation/content/jar.mn delete mode 100644 browser/components/translation/content/microsoft-translator-attribution.png delete mode 100644 browser/components/translation/content/moz.build delete mode 100644 browser/components/translation/moz.build delete mode 100644 browser/components/translation/test/bing.sjs delete mode 100644 browser/components/translation/test/browser.ini delete mode 100644 browser/components/translation/test/browser_translation_bing.js delete mode 100644 browser/components/translation/test/browser_translation_exceptions.js delete mode 100644 browser/components/translation/test/browser_translation_yandex.js delete mode 100644 browser/components/translation/test/browser_translations_settings.js delete mode 100644 browser/components/translation/test/fixtures/bug1022725-fr.html delete mode 100644 browser/components/translation/test/fixtures/result-da39a3ee5e.txt delete mode 100644 browser/components/translation/test/fixtures/result-yandex-d448894848.json delete mode 100644 browser/components/translation/test/yandex.sjs diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js index fae4dafa27e1..06156618752b 100644 --- a/browser/app/profile/firefox.js +++ b/browser/app/profile/firefox.js @@ -1814,19 +1814,10 @@ pref("media.videocontrols.picture-in-picture.video-toggle.visibility-threshold", pref("media.videocontrols.picture-in-picture.keyboard-controls.enabled", true); pref("media.videocontrols.picture-in-picture.urlbar-button.enabled", true); -// Preferences for the older translation service backed by external services. This is -// planned to be replaced with an integration of the Firefox Translations service. -// The prefs for the new service are located under "browser.translations" in -// modules/libpref/init/all.js -// -// See Bug 971044. -pref("browser.translation.detectLanguage", false); +// TODO (Bug 1817084) - This pref is used for managing translation preferences +// in the Firefox Translations addon. It should be removed when the addon is +// removed. pref("browser.translation.neverForLanguages", ""); -// Show the older translation UI that uses external services. This includes UI such as -// the info bar, notification icon and preferences. -pref("browser.translation.ui.show", false); -// Allows to define the translation engine. Google is default, Bing or Yandex are other options. -pref("browser.translation.engine", "Google"); // Enable Firefox translations powered by the Bergamot translations // engine https://browser.mt/. See Bug 971044. diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index 099fd7857a12..54f3e0898988 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -99,7 +99,6 @@ ChromeUtils.defineESModuleGetters(this, { XPCOMUtils.defineLazyModuleGetters(this, { CFRPageActions: "resource://activity-stream/lib/CFRPageActions.jsm", - Translation: "resource:///modules/translation/TranslationParent.jsm", }); XPCOMUtils.defineLazyGetter(this, "fxAccounts", () => { diff --git a/browser/base/content/test/static/browser_all_files_referenced.js b/browser/base/content/test/static/browser_all_files_referenced.js index 1949a4c275ab..c4449b9e1fd9 100644 --- a/browser/base/content/test/static/browser_all_files_referenced.js +++ b/browser/base/content/test/static/browser_all_files_referenced.js @@ -89,11 +89,6 @@ if (AppConstants.MOZ_BACKGROUNDTASKS) { gExceptionPaths.push("resource://app/modules/backgroundtasks/"); } -// Bug 1710546 https://bugzilla.mozilla.org/show_bug.cgi?id=1710546 -if (AppConstants.NIGHTLY_BUILD) { - gExceptionPaths.push("resource://builtin-addons/translations/"); -} - // Temporary allowlist for shopping - we'll reference this soon. if (AppConstants.NIGHTLY_BUILD) { gExceptionPaths.push("chrome://browser/content/shopping/shopping.html"); @@ -212,11 +207,6 @@ var whitelist = [ { file: "resource://pdf.js/web/debugger.js" }, { file: "resource://pdf.js/web/debugger.css" }, - // resource://app/modules/translation/TranslationContentHandler.jsm - { file: "resource://app/modules/translation/BingTranslator.jsm" }, - { file: "resource://app/modules/translation/GoogleTranslator.jsm" }, - { file: "resource://app/modules/translation/YandexTranslator.jsm" }, - // Starting from here, files in the whitelist are bugs that need fixing. // Bug 1339424 (wontfix?) { diff --git a/browser/components/BrowserGlue.sys.mjs b/browser/components/BrowserGlue.sys.mjs index a3dc9f9360dd..35667d5fb9cc 100644 --- a/browser/components/BrowserGlue.sys.mjs +++ b/browser/components/BrowserGlue.sys.mjs @@ -771,22 +771,6 @@ let JSWINDOWACTORS = { allFrames: true, }, - // The older translations feature backed by external services. - // This is being replaced by a newer ML-backed translation service. See Bug 971044. - Translation: { - parent: { - moduleURI: "resource:///modules/translation/TranslationParent.jsm", - }, - child: { - moduleURI: "resource:///modules/translation/TranslationChild.jsm", - events: { - pageshow: {}, - load: { mozSystemGroup: true, capture: true }, - }, - }, - enablePreference: "browser.translation.detectLanguage", - }, - UITour: { parent: { esModuleURI: "resource:///modules/UITourParent.sys.mjs", diff --git a/browser/components/moz.build b/browser/components/moz.build index ac73949a7153..94b328a9b049 100644 --- a/browser/components/moz.build +++ b/browser/components/moz.build @@ -58,7 +58,6 @@ DIRS += [ "syncedtabs", "tabunloader", "textrecognition", - "translation", "translations", "uitour", "urlbar", diff --git a/browser/components/preferences/main.inc.xhtml b/browser/components/preferences/main.inc.xhtml index 6008e71f0ff8..85dd1fb935ad 100644 --- a/browser/components/preferences/main.inc.xhtml +++ b/browser/components/preferences/main.inc.xhtml @@ -355,25 +355,7 @@ data-l10n-args='{"localeName": "und"}' preference="intl.regional_prefs.use_os_locales"/> - -