Closed Bug 1733496 Opened 4 years ago Closed 4 years ago

Migrate key-shortcuts.properties to Fluent

Categories

(DevTools :: General, task)

task

Tracking

(firefox96 fixed)

RESOLVED FIXED
96 Branch
Tracking Status
firefox96 --- fixed

People

(Reporter: zbraniecki, Assigned: eemeli)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Assignee: nobody → earo
Status: NEW → ASSIGNED

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?

Flags: needinfo?(zbraniecki)

Julian may be able to help!

Flags: needinfo?(zbraniecki) → needinfo?(jdescottes)

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,

Flags: needinfo?(jdescottes)

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.

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
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 96 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: