Closed Bug 1523763 Opened 7 months ago Closed 5 months ago

Move tab context menu-related strings out of browser.dtd and into a Fluent file

Categories

(Firefox :: Tabbed Browser, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
Firefox 68
Tracking Status
firefox68 --- fixed

People

(Reporter: jaws, Assigned: chenbri2, Mentored)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 1 obsolete file)

The tab context menu strings aren't required to be in browser.dtd. We can move them out of browser.dtd and into a Fluent file.

The string resource IDs will still get hard-coded on the context menu items but we will not load the localization resource until it is necessary, which will remove any potential startup delays that Fluent might introduce.

The attached patch shows a rough proof-of-concept of how this can work.

The new Fluent file should be created at:
/browser/locales/en-US/browser/tabContextMenu.ftl

The migration script should be created at:
/python/l10n/fluent_migrations

/browser/base/content/browser.xul will need to be updated to replace the label and accesskey attributes with a data-1l0n-id attribute.

tabbrowser.js will need to insert the .ftl file when the tab gets a mouseover event or a focus event.

Attachment #9039937 - Attachment description: Bug 1523763 - Proof-of-concept patch that pulls out tab context menu strings to FTL file loaded on-dema nd. → Bug 1523763 - Proof-of-concept patch that pulls out tab context menu strings to FTL file loaded on-demand.
Priority: -- → P3

insertFTLIfNeeded should be used instead of the manual createElement calls that I have in the attached POC.

Assignee: nobody → chenbri2
Status: NEW → ASSIGNED

Moved tab context menu out of browser.dtd to browser.xul except for sendPageToDevice, sendLinkToDevice, moveTabOptions, moveSelectedTabOptions, undoCloseTab. Not sure if tabbrowser.js and tabbrowser.xul are working as intended.

Attachment #9042839 - Attachment description: Bug 152376 - Move tab context menu strings to FTL file loaded on-demand. r= → Bug 1523763 - Move tab context menu strings to FTL file loaded on-demand. r=
Attachment #9042839 - Attachment description: Bug 1523763 - Move tab context menu strings to FTL file loaded on-demand. r= → Bug 15237631 - Move tab context menu strings to FTL file loaded on-demand. r=
Attachment #9042839 - Attachment description: Bug 15237631 - Move tab context menu strings to FTL file loaded on-demand. r= → Bug 15237631 - Move tab context menu strings to FTL file loaded on-demand. r= Gijs, flod
Attachment #9039937 - Attachment is obsolete: true
Attachment #9042839 - Attachment description: Bug 15237631 - Move tab context menu strings to FTL file loaded on-demand. r= Gijs, flod → Bug 1523763 - Move tab context menu strings to FTL file loaded on-demand. r= Gijs, flod
Attachment #9042839 - Attachment description: Bug 1523763 - Move tab context menu strings to FTL file loaded on-demand. r= Gijs, flod → Bug 1523763 - Move tab context menu strings to FTL file loaded on-demand. r=Gijs,flod
Pushed by gijskruitbosch@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/028c0eff90a7
Move tab context menu strings to FTL file loaded on-demand. r=Gijs,flod
Status: ASSIGNED → RESOLVED
Closed: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 68
Regressions: 1555453
You need to log in before you can comment on or make changes to this bug.