Migrate key-shortcuts.properties to Fluent
Categories
(DevTools :: General, task)
Tracking
(firefox96 fixed)
Tracking | Status | |
---|---|---|
firefox96 | --- | fixed |
People
(Reporter: zbraniecki, Assigned: eemeli)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
The file itself is easy to migrate and there are just a few callsites - https://searchfox.org/mozilla-central/search?q=key-shortcuts.properties&path=&case=false®exp=false
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Comment 1•2 years ago
|
||
I'm struggling a bit with migrating the callsite in devtools/client/definitions.js
, as the Localization
constructor does not appear to be available there.
Zibi, who should I ask for guidance here?
Reporter | ||
Comment 2•2 years ago
|
||
Julian may be able to help!
Comment 3•2 years ago
•
|
||
Hi! DevTools modules are loaded in a Sandbox, and we need to expose new globals coming from the JSM scope manually. Here's a diff you can apply to do this for Localization:
diff --git a/devtools/shared/builtin-modules.js b/devtools/shared/builtin-modules.js
--- a/devtools/shared/builtin-modules.js
+++ b/devtools/shared/builtin-modules.js
@@ -24,16 +24,17 @@ const {
BrowsingContext,
console,
DebuggerNotificationObserver,
DOMPoint,
DOMQuad,
DOMRect,
HeapSnapshot,
L10nRegistry,
+ Localization,
NamedNodeMap,
NodeFilter,
StructuredCloneHolder,
TelemetryStopwatch,
} = Cu.getGlobalForObject(jsmScope);
// Create a single Sandbox to access global properties needed in this module.
// Sandbox are memory expensive, so we should create as little as possible.
@@ -271,16 +272,17 @@ exports.globals = {
loader: {
lazyGetter: defineLazyGetter,
lazyImporter: defineLazyModuleGetter,
lazyServiceGetter: defineLazyServiceGetter,
lazyRequireGetter: lazyRequireGetter,
// Defined by Loader.jsm
id: null,
},
+ Localization,
Node,
reportError: Cu.reportError,
StructuredCloneHolder,
TextDecoder,
TextEncoder,
URL,
Window,
XMLHttpRequest,
Assignee | ||
Comment 4•2 years ago
|
||
This adds Localization
to builtin-modules.js
to make it accessible from
definitions.js
. It's likely that the abstractions used in definitions.js
will need to be revisited when startup.properties
is also migrated to Fluent.
Assignee | ||
Comment 5•2 years ago
|
||
Thank you! That's exactly the info I needed. Patch submitted for review.
Pushed by flodolo@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/55ed5c6f9f97 Migrate key-shortcuts.properties to Fluent. r=jdescottes,fluent-reviewers
Comment 7•2 years ago
|
||
bugherder |
Description
•