Closed Bug 1580978 Opened 5 years ago Closed 5 years ago

Migrate the notification-popup-box element to ftl

Categories

(Firefox :: Site Identity, task, P1)

task

Tracking

()

RESOLVED FIXED
Firefox 71
Tracking Status
firefox71 --- fixed

People

(Reporter: bgrins, Assigned: bgrins)

References

Details

Attachments

(2 files)

I'd like to try this as a follow on to Bug 1579540 to see how much we can automate a single element + children within browser.xhtml.

Component: General → Site Identity and Permission Panels
Priority: -- → P1
Pushed by bgrinstead@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/4f4d06a264e6 Migrate the notification-popup-box element to ftl r=fluent-reviewers,flod,johannh https://hg.mozilla.org/integration/autoland/rev/4aff09a9a1c8 Rename browser-urlbar-identity-button to urlbar-identity-button r=fluent-reviewers,flod

Overall this script worked well and saved a bunch of time compared with doing this by hand. Here are some notes about the process here, including some things that should be fixed in the automation:

Steps to build:

  1. Copy <box id="notification-popup-box"> markup from browser.xhtml into a new file (./temp-notification-box.xhtml)
  2. python python/l10n/convert_xul_to_fluent/convert.py 1580978 ./temp-notification-box.xhtml ./browser/locales/en-US/browser/browser.ftl ./ ./browser/locales/en-US/chrome/browser/browser.dtd "Migrate the notification-popup-box element to ftl"

Extra steps for the markup:

  1. Take the output from command and replace "-anchor-tooltip" with "-anchor". This is a bug-specific change that is probably not automatable (it's just that the dtd entities included tooltip in the name but now we want to target only the element with the ftl id).
  2. Properly reformat the generated markup from stdout (newlines were removed, alignment is off in certain cases).
  3. Paste the cleaned up markup back into browser.xhtml.

Extra steps for the FTL file:

  1. Find/replace "-anchor-tooltip" with "-anchor" as per (1) above.
  2. This command overwrote the existing browser.ftl. I had to revert that and then re-add the new part only. We should append instead of overwriting ftl files.

Extra steps for the generated migration script:

  1. Find/replace "-anchor-tooltip" with "-anchor" as per (1) above.
  2. Cleanup trailing whitespace from the migration script (./mach lint --outgoing --fix). We should avoid adding them in the first place
  3. Replace "./browser/chrome/browser/browser.dtd" -> "browser/chrome/browser/browser.dtd". We should use the right path in the first place.
  4. Replace "./browser/browser/browser.ftl" -> "browser/browser/browser.ftl". We should use the right path in the first place.
  5. Confirm it worked with `./mach fluent-migration-test python/l10n/fluent_migrations/bug_1579540_migrate-the-notification-popup-box-to-ftl.py
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 71
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: