Closed Bug 1580978 Opened 2 months ago Closed 2 months ago

Migrate the notification-popup-box element to ftl


(Firefox :: Site Identity, task, P1)




Firefox 71
Tracking Status
firefox71 --- fixed


(Reporter: bgrins, Assigned: bgrins)


(Blocks 1 open bug)



(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
Migrate the notification-popup-box element to ftl r=fluent-reviewers,flod,johannh
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/ 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/
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 71
You need to log in before you can comment on or make changes to this bug.