Closed Bug 1730893 Opened 3 months ago Closed 2 months ago

Localize the popup's button tooltip when changing state

Categories

(DevTools :: Performance Tools (Profiler/Timeline), defect, P2)

defect

Tracking

(firefox95 fixed)

RESOLVED FIXED
95 Branch
Tracking Status
firefox95 --- fixed

People

(Reporter: julienw, Assigned: julienw)

References

(Blocks 1 open bug)

Details

Attachments

(3 files)

Currently, when the profiler's state changes, the tooltip's text is hardcoded:
See https://searchfox.org/mozilla-central/rev/a82dd14b6bc3d05a6a3facc126607e6d34cc2f53/devtools/client/performance-new/popup/menu-button.jsm.js#268-291

We need to localize this.

The button's label and tooltip are currently handled the old way in a properties file, and we should easily move that to a ftl file instead.

Here is an example:
https://hg.mozilla.org/mozilla-central/rev/33d959e23d7e65bd9f5ca462777d3bbc465ef266

Basically we need to move from "tooltiptext" to "l10nId" when defining the popup, and replace the existing translations in https://searchfox.org/mozilla-central/rev/a82dd14b6bc3d05a6a3facc126607e6d34cc2f53/browser/locales/en-US/chrome/browser/customizableui/customizableWidgets.properties#17-18 by new ones in a FTL file (possibly browser.ftl).

Then we can use these translations on the button with l10n.setAttributes.

Assignee: nobody → felash

The profiler popup widget was using the old properties-based way of
translating its label and tooltips. Moreover the tooltips weren't
translated anymore when recording/capturing. This patch fixes this by
moving to Fluent and using Fluent to change the button's tooltips when
the state changes.

This fixes a warning when Fluent translates these buttons: previously it
was removing the content, which we don't control. The proper way is
assigning attributes instead.

This also required touching the style a bit.

Depends on D127677

Pushed by jwajsberg@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/4aa923342154
[devtools profiler] Localize the profiler button using Fluent instead of properties r=jdescottes,fluent-reviewers,nbaumgardner,flod
https://hg.mozilla.org/integration/autoland/rev/01343fa8b6c5
[devtools profiler] Properly localize buttons in the profiler popup r=jdescottes,fluent-reviewers,desktop-theme-reviewers,nbaumgardner,harry,flod
https://hg.mozilla.org/integration/autoland/rev/86b88ba429a3
[devtools profiler] Add a migration script for the localization changes r=flod
Status: NEW → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 95 Branch
Regressions: 1738871
You need to log in before you can comment on or make changes to this bug.