Bug 1859081 - Move cld2 from toolkit/component/translation to translations; r=translations-reviewers,zeid,frontend-codestyle-reviewers,nordzilla

We developed the new translations codebase using an "s" at the end, and
retained the old translations code under "translation". At this point
I'm unifying it so that it's all under "translations", which involves a
rename of the existing code. This way we will be consistent in our
naming practice.

Differential Revision: https://phabricator.services.mozilla.com/D239047
This commit is contained in:
Greg Tatum
2025-02-26 20:06:25 +00:00
parent a3652a49ee
commit 121327c607
79 changed files with 22 additions and 32 deletions

View File

@@ -202,7 +202,7 @@ testing/web-platform/tests/tools/third_party/.*
third_party/.* third_party/.*
toolkit/components/jsoncpp/.* toolkit/components/jsoncpp/.*
toolkit/components/protobuf/.* toolkit/components/protobuf/.*
toolkit/components/translation/cld2/.* toolkit/components/translations/cld2/.*
toolkit/components/url-classifier/chromium/.* toolkit/components/url-classifier/chromium/.*
toolkit/components/url-classifier/protobuf/.* toolkit/components/url-classifier/protobuf/.*
toolkit/crashreporter/breakpad-client/.* toolkit/crashreporter/breakpad-client/.*

View File

@@ -277,7 +277,7 @@ module.exports = [
"toolkit/components/reader/Readerable.sys.mjs", "toolkit/components/reader/Readerable.sys.mjs",
// Generated & special files in cld2 // Generated & special files in cld2
"toolkit/components/translation/cld2/", "toolkit/components/translations/cld2/",
// Uses preprocessing // Uses preprocessing
"toolkit/mozapps/update/tests/data/xpcshellConstantsPP.js", "toolkit/mozapps/update/tests/data/xpcshellConstantsPP.js",

View File

@@ -387,7 +387,6 @@ const rollouts = [
"toolkit/components/telemetry/**", "toolkit/components/telemetry/**",
"toolkit/components/thumbnails/**", "toolkit/components/thumbnails/**",
"toolkit/components/timermanager/UpdateTimerManager.*", "toolkit/components/timermanager/UpdateTimerManager.*",
"toolkit/components/translation/LanguageDetector.*",
"toolkit/components/url-classifier/**", "toolkit/components/url-classifier/**",
"toolkit/components/utils/**", "toolkit/components/utils/**",
"toolkit/components/viewsource/**", "toolkit/components/viewsource/**",
@@ -550,7 +549,6 @@ const rollouts = [
"toolkit/components/telemetry/**", "toolkit/components/telemetry/**",
"toolkit/components/thumbnails/**", "toolkit/components/thumbnails/**",
"toolkit/components/timermanager/UpdateTimerManager.*", "toolkit/components/timermanager/UpdateTimerManager.*",
"toolkit/components/translation/LanguageDetector.*",
"toolkit/components/translations/**", "toolkit/components/translations/**",
"toolkit/components/uniffi-bindgen-gecko-js/fixtures/tests/xpcshell/test_callbacks.js", "toolkit/components/uniffi-bindgen-gecko-js/fixtures/tests/xpcshell/test_callbacks.js",
"toolkit/components/uniffi-js/js/UniFFI.sys.mjs", "toolkit/components/uniffi-js/js/UniFFI.sys.mjs",

View File

@@ -1213,7 +1213,7 @@ toolkit/components/pdfjs/content/web
toolkit/components/reader/Readerable.sys.mjs toolkit/components/reader/Readerable.sys.mjs
# Generated & special files in cld2 # Generated & special files in cld2
toolkit/components/translation/cld2/ toolkit/components/translations/cld2/
# Uses preprocessing # Uses preprocessing
toolkit/mozapps/update/tests/data/xpcshellConstantsPP.js toolkit/mozapps/update/tests/data/xpcshellConstantsPP.js
@@ -1433,7 +1433,7 @@ toolkit/components/passwordmgr/shared/PasswordRulesParser.sys.mjs
toolkit/components/protobuf/ toolkit/components/protobuf/
toolkit/components/reader/readability/ toolkit/components/reader/readability/
toolkit/components/resistfingerprinting/content/gl-matrix.js toolkit/components/resistfingerprinting/content/gl-matrix.js
toolkit/components/translation/cld2/ toolkit/components/translations/cld2/
toolkit/components/translations/bergamot-translator/thirdparty toolkit/components/translations/bergamot-translator/thirdparty
toolkit/components/translations/bergamot-translator/bergamot-translator.js toolkit/components/translations/bergamot-translator/bergamot-translator.js
toolkit/components/url-classifier/chromium/ toolkit/components/url-classifier/chromium/

View File

@@ -65,7 +65,7 @@ const intermittently_loaded_scripts = {
// Translations code which may be preffed on. // Translations code which may be preffed on.
"resource://gre/actors/TranslationsChild.sys.mjs", "resource://gre/actors/TranslationsChild.sys.mjs",
"resource://gre/modules/translation/LanguageDetector.sys.mjs", "resource://gre/modules/translations/LanguageDetector.sys.mjs",
"resource://gre/modules/ConsoleAPIStorage.sys.mjs", // Logging related. "resource://gre/modules/ConsoleAPIStorage.sys.mjs", // Logging related.
// Session store. // Session store.

View File

@@ -11,7 +11,7 @@
ChromeUtils.defineESModuleGetters(this, { ChromeUtils.defineESModuleGetters(this, {
LanguageDetector: LanguageDetector:
"resource://gre/modules/translation/LanguageDetector.sys.mjs", "resource://gre/modules/translations/LanguageDetector.sys.mjs",
TranslationsPanelShared: TranslationsPanelShared:
"chrome://browser/content/translations/TranslationsPanelShared.sys.mjs", "chrome://browser/content/translations/TranslationsPanelShared.sys.mjs",
TranslationsUtils: TranslationsUtils:

View File

@@ -606,7 +606,7 @@ bool nsContentSecurityUtils::IsEvalAllowed(JSContext* cx,
"resource://testing-common/content-task.js"_ns, "resource://testing-common/content-task.js"_ns,
// Tracked by Bug 1584605 // Tracked by Bug 1584605
"resource://gre/modules/translation/cld-worker.js"_ns, "resource://gre/modules/translations/cld-worker.js"_ns,
// require.js implements a script loader for workers. It uses eval // require.js implements a script loader for workers. It uses eval
// to load the script; but injection is only possible in situations // to load the script; but injection is only possible in situations

View File

@@ -4495,7 +4495,6 @@ modules:
new translation language models. new translation language models.
includes: includes:
- toolkit/components/translations/**/* - toolkit/components/translations/**/*
- toolkit/components/translation/**/*
- browser/components/translations/**/* - browser/components/translations/**/*
excludes: [] excludes: []
owners: owners:

View File

@@ -17,7 +17,7 @@ ChromeUtils.defineESModuleGetters(lazy, {
ExtensionUserScriptsContent: ExtensionUserScriptsContent:
"resource://gre/modules/ExtensionUserScriptsContent.sys.mjs", "resource://gre/modules/ExtensionUserScriptsContent.sys.mjs",
LanguageDetector: LanguageDetector:
"resource://gre/modules/translation/LanguageDetector.sys.mjs", "resource://gre/modules/translations/LanguageDetector.sys.mjs",
Schemas: "resource://gre/modules/Schemas.sys.mjs", Schemas: "resource://gre/modules/Schemas.sys.mjs",
WebNavigationFrames: "resource://gre/modules/WebNavigationFrames.sys.mjs", WebNavigationFrames: "resource://gre/modules/WebNavigationFrames.sys.mjs",
}); });

View File

@@ -6,7 +6,7 @@
ChromeUtils.defineESModuleGetters(this, { ChromeUtils.defineESModuleGetters(this, {
LanguageDetector: LanguageDetector:
"resource://gre/modules/translation/LanguageDetector.sys.mjs", "resource://gre/modules/translations/LanguageDetector.sys.mjs",
}); });
this.i18n = class extends ExtensionAPI { this.i18n = class extends ExtensionAPI {

View File

@@ -76,7 +76,6 @@ DIRS += [
"startup", "startup",
"statusfilter", "statusfilter",
"telemetry", "telemetry",
"translation",
"translations", "translations",
"thumbnails", "thumbnails",
"timermanager", "timermanager",

View File

@@ -34,7 +34,7 @@ const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, { ChromeUtils.defineESModuleGetters(lazy, {
LanguageDetector: LanguageDetector:
"resource://gre/modules/translation/LanguageDetector.sys.mjs", "resource://gre/modules/translations/LanguageDetector.sys.mjs",
ReaderWorker: "resource://gre/modules/reader/ReaderWorker.sys.mjs", ReaderWorker: "resource://gre/modules/reader/ReaderWorker.sys.mjs",
Readerable: "resource://gre/modules/Readerable.sys.mjs", Readerable: "resource://gre/modules/Readerable.sys.mjs",
}); });

View File

@@ -1,14 +0,0 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
with Files("**"):
BUG_COMPONENT = ("Firefox", "Translations")
EXTRA_JS_MODULES.translation = [
"cld2/cld-worker.js",
"cld2/cld-worker.js.mem",
"LanguageDetector.sys.mjs",
]
XPCSHELL_TESTS_MANIFESTS += ["test/unit/xpcshell.toml"]

View File

@@ -13,7 +13,7 @@ ChromeUtils.defineLazyGetter(lazy, "console", () => {
ChromeUtils.defineESModuleGetters(lazy, { ChromeUtils.defineESModuleGetters(lazy, {
LanguageDetector: LanguageDetector:
"resource://gre/modules/translation/LanguageDetector.sys.mjs", "resource://gre/modules/translations/LanguageDetector.sys.mjs",
}); });
/** /**

View File

@@ -9,7 +9,7 @@ ChromeUtils.defineESModuleGetters(lazy, {
LRUCache: LRUCache:
"chrome://global/content/translations/translations-document.sys.mjs", "chrome://global/content/translations/translations-document.sys.mjs",
LanguageDetector: LanguageDetector:
"resource://gre/modules/translation/LanguageDetector.sys.mjs", "resource://gre/modules/translations/LanguageDetector.sys.mjs",
}); });
/** /**

View File

@@ -13,5 +13,13 @@ DIRS += ["actors"]
BROWSER_CHROME_MANIFESTS += ["tests/browser/browser.toml"] BROWSER_CHROME_MANIFESTS += ["tests/browser/browser.toml"]
XPCSHELL_TESTS_MANIFESTS += ["tests/unit/xpcshell.toml"]
EXTRA_JS_MODULES.translations = [
"cld2/cld-worker.js",
"cld2/cld-worker.js.mem",
"LanguageDetector.sys.mjs",
]
with Files("docs/**"): with Files("docs/**"):
SCHEDULES.exclusive = ["docs"] SCHEDULES.exclusive = ["docs"]

View File

@@ -571,7 +571,7 @@ const { setTimeout } = ChromeUtils.importESModule(
"resource://gre/modules/Timer.sys.mjs" "resource://gre/modules/Timer.sys.mjs"
); );
let { LanguageDetector, workerManager } = ChromeUtils.importESModule( let { LanguageDetector, workerManager } = ChromeUtils.importESModule(
"resource://gre/modules/translation/LanguageDetector.sys.mjs" "resource://gre/modules/translations/LanguageDetector.sys.mjs"
); );
function check_result(result, langCode, expected) { function check_result(result, langCode, expected) {

View File

@@ -190,7 +190,7 @@ toolkit/components/passwordmgr/shared/PasswordRulesParser.sys.mjs
toolkit/components/protobuf/ toolkit/components/protobuf/
toolkit/components/reader/readability/ toolkit/components/reader/readability/
toolkit/components/resistfingerprinting/content/gl-matrix.js toolkit/components/resistfingerprinting/content/gl-matrix.js
toolkit/components/translation/cld2/ toolkit/components/translations/cld2/
toolkit/components/translations/bergamot-translator/thirdparty toolkit/components/translations/bergamot-translator/thirdparty
toolkit/components/translations/bergamot-translator/bergamot-translator.js toolkit/components/translations/bergamot-translator/bergamot-translator.js
toolkit/components/url-classifier/chromium/ toolkit/components/url-classifier/chromium/