Skip to content

Commit

Permalink
Bug 1859081 - Move cld2 from toolkit/component/translation to transla…
Browse files Browse the repository at this point in the history
…tions; 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
  • Loading branch information
gregtatum committed Feb 26, 2025
1 parent aca5891 commit aa75c23
Show file tree
Hide file tree
Showing 79 changed files with 22 additions and 32 deletions.
2 changes: 1 addition & 1 deletion .clang-format-ignore
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ testing/web-platform/tests/tools/third_party/.*
third_party/.*
toolkit/components/jsoncpp/.*
toolkit/components/protobuf/.*
toolkit/components/translation/cld2/.*
toolkit/components/translations/cld2/.*
toolkit/components/url-classifier/chromium/.*
toolkit/components/url-classifier/protobuf/.*
toolkit/crashreporter/breakpad-client/.*
Expand Down
2 changes: 1 addition & 1 deletion .eslintrc-ignores.js
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ module.exports = [
"toolkit/components/reader/Readerable.sys.mjs",

// Generated & special files in cld2
"toolkit/components/translation/cld2/",
"toolkit/components/translations/cld2/",

// Uses preprocessing
"toolkit/mozapps/update/tests/data/xpcshellConstantsPP.js",
Expand Down
2 changes: 0 additions & 2 deletions .eslintrc-rollouts.js
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,6 @@ const rollouts = [
"toolkit/components/telemetry/**",
"toolkit/components/thumbnails/**",
"toolkit/components/timermanager/UpdateTimerManager.*",
"toolkit/components/translation/LanguageDetector.*",
"toolkit/components/url-classifier/**",
"toolkit/components/utils/**",
"toolkit/components/viewsource/**",
Expand Down Expand Up @@ -550,7 +549,6 @@ const rollouts = [
"toolkit/components/telemetry/**",
"toolkit/components/thumbnails/**",
"toolkit/components/timermanager/UpdateTimerManager.*",
"toolkit/components/translation/LanguageDetector.*",
"toolkit/components/translations/**",
"toolkit/components/uniffi-bindgen-gecko-js/fixtures/tests/xpcshell/test_callbacks.js",
"toolkit/components/uniffi-js/js/UniFFI.sys.mjs",
Expand Down
4 changes: 2 additions & 2 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -1213,7 +1213,7 @@ toolkit/components/pdfjs/content/web
toolkit/components/reader/Readerable.sys.mjs

# Generated & special files in cld2
toolkit/components/translation/cld2/
toolkit/components/translations/cld2/

# Uses preprocessing
toolkit/mozapps/update/tests/data/xpcshellConstantsPP.js
Expand Down Expand Up @@ -1433,7 +1433,7 @@ toolkit/components/passwordmgr/shared/PasswordRulesParser.sys.mjs
toolkit/components/protobuf/
toolkit/components/reader/readability/
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/bergamot-translator.js
toolkit/components/url-classifier/chromium/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const intermittently_loaded_scripts = {

// Translations code which may be preffed on.
"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.

// Session store.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

ChromeUtils.defineESModuleGetters(this, {
LanguageDetector:
"resource://gre/modules/translation/LanguageDetector.sys.mjs",
"resource://gre/modules/translations/LanguageDetector.sys.mjs",
TranslationsPanelShared:
"chrome://browser/content/translations/TranslationsPanelShared.sys.mjs",
TranslationsUtils:
Expand Down
2 changes: 1 addition & 1 deletion dom/security/nsContentSecurityUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,7 @@ bool nsContentSecurityUtils::IsEvalAllowed(JSContext* cx,
"resource://testing-common/content-task.js"_ns,

// 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
// to load the script; but injection is only possible in situations
Expand Down
1 change: 0 additions & 1 deletion mots.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4495,7 +4495,6 @@ modules:
new translation language models.
includes:
- toolkit/components/translations/**/*
- toolkit/components/translation/**/*
- browser/components/translations/**/*
excludes: []
owners:
Expand Down
2 changes: 1 addition & 1 deletion toolkit/components/extensions/ExtensionContent.sys.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ ChromeUtils.defineESModuleGetters(lazy, {
ExtensionUserScriptsContent:
"resource://gre/modules/ExtensionUserScriptsContent.sys.mjs",
LanguageDetector:
"resource://gre/modules/translation/LanguageDetector.sys.mjs",
"resource://gre/modules/translations/LanguageDetector.sys.mjs",
Schemas: "resource://gre/modules/Schemas.sys.mjs",
WebNavigationFrames: "resource://gre/modules/WebNavigationFrames.sys.mjs",
});
Expand Down
2 changes: 1 addition & 1 deletion toolkit/components/extensions/parent/ext-i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

ChromeUtils.defineESModuleGetters(this, {
LanguageDetector:
"resource://gre/modules/translation/LanguageDetector.sys.mjs",
"resource://gre/modules/translations/LanguageDetector.sys.mjs",
});

this.i18n = class extends ExtensionAPI {
Expand Down
1 change: 0 additions & 1 deletion toolkit/components/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ DIRS += [
"startup",
"statusfilter",
"telemetry",
"translation",
"translations",
"thumbnails",
"timermanager",
Expand Down
2 changes: 1 addition & 1 deletion toolkit/components/reader/ReaderMode.sys.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const lazy = {};

ChromeUtils.defineESModuleGetters(lazy, {
LanguageDetector:
"resource://gre/modules/translation/LanguageDetector.sys.mjs",
"resource://gre/modules/translations/LanguageDetector.sys.mjs",
ReaderWorker: "resource://gre/modules/reader/ReaderWorker.sys.mjs",
Readerable: "resource://gre/modules/Readerable.sys.mjs",
});
Expand Down
14 changes: 0 additions & 14 deletions toolkit/components/translation/moz.build

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ ChromeUtils.defineLazyGetter(lazy, "console", () => {

ChromeUtils.defineESModuleGetters(lazy, {
LanguageDetector:
"resource://gre/modules/translation/LanguageDetector.sys.mjs",
"resource://gre/modules/translations/LanguageDetector.sys.mjs",
});

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ChromeUtils.defineESModuleGetters(lazy, {
LRUCache:
"chrome://global/content/translations/translations-document.sys.mjs",
LanguageDetector:
"resource://gre/modules/translation/LanguageDetector.sys.mjs",
"resource://gre/modules/translations/LanguageDetector.sys.mjs",
});

/**
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 8 additions & 0 deletions toolkit/components/translations/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,13 @@ DIRS += ["actors"]

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/**"):
SCHEDULES.exclusive = ["docs"]
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ const { setTimeout } = ChromeUtils.importESModule(
"resource://gre/modules/Timer.sys.mjs"
);
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) {
Expand Down
2 changes: 1 addition & 1 deletion tools/rewriting/ThirdPartyPaths.txt
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ toolkit/components/passwordmgr/shared/PasswordRulesParser.sys.mjs
toolkit/components/protobuf/
toolkit/components/reader/readability/
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/bergamot-translator.js
toolkit/components/url-classifier/chromium/
Expand Down

0 comments on commit aa75c23

Please sign in to comment.