Bug 1523747 - Move customize mode strings over to fluent, r=Gijs,jaws,flod
authorNicholas Cowles <cowlesni@msu.edu>
Wed, 10 Apr 2019 15:46:31 +0000
changeset 468812 71363080b33a217ccfb66350a7d44eeaf07c45c2
parent 468811 39655232be1dcb58e8ccf82018a762803001ffba
child 468813 5967ffe89473dc2cc5ecdd516a83a126b8b57755
push id112755
push userdvarga@mozilla.com
push dateWed, 10 Apr 2019 22:06:41 +0000
treeherdermozilla-inbound@606f85641d0b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs, jaws, flod
bugs1523747
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1523747 - Move customize mode strings over to fluent, r=Gijs,jaws,flod Differential Revision: https://phabricator.services.mozilla.com/D26418
browser/base/content/browser.xul
browser/components/customizableui/CustomizeMode.jsm
browser/components/customizableui/content/customizeMode.inc.xul
browser/locales/en-US/browser/customizeMode.ftl
browser/locales/en-US/chrome/browser/browser.dtd
python/l10n/convert_xul_to_fluent/convert.py
python/l10n/convert_xul_to_fluent/lib/migration.py
python/l10n/convert_xul_to_fluent/lib/xul.py
python/l10n/fluent_migrations/bug_1523747_customizeMode.py
--- a/browser/base/content/browser.xul
+++ b/browser/base/content/browser.xul
@@ -1333,17 +1333,19 @@
         <tabbox id="tabbrowser-tabbox"
                 flex="1" tabcontainer="tabbrowser-tabs">
           <tabpanels id="tabbrowser-tabpanels"
                      flex="1" class="plain" selectedIndex="0"/>
         </tabbox>
       </vbox>
       <vbox id="browser-border-end" hidden="true" layer="true"/>
     </hbox>
+    <box id="customization-container" flex="1" hidden="true"><![CDATA[
 #include ../../components/customizableui/content/customizeMode.inc.xul
+    ]]></box>
   </deck>
 
   <html:div id="fullscreen-warning" class="pointerlockfswarning" hidden="true" renderroot="content">
     <html:div class="pointerlockfswarning-domain-text">
       &fullscreenWarning.beforeDomain.label;
       <html:span class="pointerlockfswarning-domain"/>
       &fullscreenWarning.afterDomain.label;
     </html:div>
--- a/browser/components/customizableui/CustomizeMode.jsm
+++ b/browser/components/customizableui/CustomizeMode.jsm
@@ -95,16 +95,22 @@ function unregisterGlobalTab() {
 }
 
 function CustomizeMode(aWindow) {
   this.window = aWindow;
   this.document = aWindow.document;
   this.browser = aWindow.gBrowser;
   this.areas = new Set();
 
+  let content = this.$("customization-content-container");
+  if (!content) {
+    this.window.MozXULElement.insertFTLIfNeeded("browser/customizeMode.ftl");
+    let container = this.$("customization-container");
+    container.replaceChild(this.window.MozXULElement.parseXULToFragment(container.firstChild.data), container.lastChild);
+  }
   // There are two palettes - there's the palette that can be overlayed with
   // toolbar items in browser.xul. This is invisible, and never seen by the
   // user. Then there's the visible palette, which gets populated and displayed
   // to the user when in customizing mode.
   this.visiblePalette = this.$(kPaletteId);
   this.pongArena = this.$("customization-pong-arena");
 
   if (this._canDrawInTitlebar()) {
--- a/browser/components/customizableui/content/customizeMode.inc.xul
+++ b/browser/components/customizableui/content/customizeMode.inc.xul
@@ -1,140 +1,127 @@
 <!-- This Source Code Form is subject to the terms of the Mozilla Public
    - License, v. 2.0. If a copy of the MPL was not distributed with this
    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
 
-<box id="customization-container" flex="1" hidden="true">
-  <box id="customization-content-container">
-    <box flex="1" id="customization-palette-container">
-      <label id="customization-header">
-        &customizeMode.menuAndToolbars.header3;
-      </label>
-      <vbox id="customization-palette" class="customization-palette" hidden="true"/>
-      <vbox id="customization-pong-arena" hidden="true"/>
-      <spacer id="customization-spacer"/>
+<box id="customization-content-container">
+<box flex="1" id="customization-palette-container">
+  <label id="customization-header" data-l10n-id="customize-mode-menu-and-toolbars-header"></label>
+  <vbox id="customization-palette" class="customization-palette" hidden="true"/>
+  <vbox id="customization-pong-arena" hidden="true"/>
+  <spacer id="customization-spacer"/>
+</box>
+<vbox id="customization-panel-container">
+  <vbox id="customization-panelWrapper">
+    <box class="panel-arrowbox">
+      <image class="panel-arrow" side="top"/>
     </box>
-    <vbox id="customization-panel-container">
-      <vbox id="customization-panelWrapper">
-        <box class="panel-arrowbox">
-          <image class="panel-arrow" side="top"/>
-        </box>
-        <box class="panel-arrowcontent" side="top" flex="1">
-          <vbox id="customization-panelHolder">
-            <description id="customization-panelHeader">&customizeMode.overflowList.title2;</description>
-            <description id="customization-panelDescription">&customizeMode.overflowList.description;</description>
-          </vbox>
-          <box class="panel-inner-arrowcontentfooter" hidden="true"/>
-        </box>
+    <box class="panel-arrowcontent" side="top" flex="1">
+      <vbox id="customization-panelHolder">
+        <description id="customization-panelHeader" data-l10n-id="customize-mode-overflow-list-title"></description>
+        <description id="customization-panelDescription" data-l10n-id="customize-mode-overflow-list-description"></description>
       </vbox>
-    </vbox>
-  </box>
-  <hbox id="customization-footer">
-    <checkbox id="customization-titlebar-visibility-checkbox" class="customizationmode-checkbox"
-              label="&customizeMode.titlebar;"
+      <box class="panel-inner-arrowcontentfooter" hidden="true"/>
+    </box>
+  </vbox>
+</vbox>
+</box>
+<hbox id="customization-footer">
+<checkbox id="customization-titlebar-visibility-checkbox" class="customizationmode-checkbox"
 # NB: because oncommand fires after click, by the time we've fired, the checkbox binding
 #    will already have switched the button's state, so this is correct:
-              oncommand="gCustomizeMode.toggleTitlebar(this.checked)"/>
-    <checkbox id="customization-extra-drag-space-checkbox" class="customizationmode-checkbox"
-              label="&customizeMode.extraDragSpace;"
-              oncommand="gCustomizeMode.toggleDragSpace(this.checked)"/>
-    <button id="customization-toolbar-visibility-button" label="&customizeMode.toolbars2;" class="customizationmode-button" type="menu">
-      <menupopup id="customization-toolbar-menu" onpopupshowing="onViewToolbarsPopupShowing(event)"/>
-    </button>
-    <button id="customization-lwtheme-button" label="&customizeMode.lwthemes;" class="customizationmode-button" type="menu">
-      <panel type="arrow" id="customization-lwtheme-menu"
-             onpopupshowing="gCustomizeMode.onThemesMenuShowing(event);"
-             position="topcenter bottomleft"
-             flip="none"
-             role="menu">
-        <label id="customization-lwtheme-menu-header" value="&customizeMode.lwthemes.myThemes;"/>
-        <hbox id="customization-lwtheme-menu-footer">
-          <toolbarbutton class="customization-lwtheme-menu-footeritem"
-                         label="&customizeMode.lwthemes.menuManage;"
-                         accesskey="&customizeMode.lwthemes.menuManage.accessKey;"
-                         tabindex="0"
-                         oncommand="gCustomizeMode.openAddonsManagerThemes(event);"/>
-          <toolbarbutton class="customization-lwtheme-menu-footeritem"
-                         label="&customizeMode.lwthemes.menuGetMore;"
-                         accesskey="&customizeMode.lwthemes.menuGetMore.accessKey;"
-                         tabindex="0"
-                         oncommand="gCustomizeMode.getMoreThemes(event);"/>
-        </hbox>
-      </panel>
-    </button>
-    <button id="customization-uidensity-button"
-            label="&customizeMode.uidensity;"
-            class="customizationmode-button"
-            type="menu">
-      <panel type="arrow" id="customization-uidensity-menu"
-             onpopupshowing="gCustomizeMode.onUIDensityMenuShowing();"
-             position="topcenter bottomleft"
-             flip="none"
-             role="menu">
-        <menuitem id="customization-uidensity-menuitem-compact"
-                  class="menuitem-iconic customization-uidensity-menuitem"
-                  role="menuitemradio"
-                  label="&customizeMode.uidensity.menuCompact.label;"
-                  accesskey="&customizeMode.uidensity.menuCompact.accessKey;"
-                  tooltiptext="&customizeMode.uidensity.menuCompact.tooltip;"
-                  tabindex="0"
-                  onfocus="gCustomizeMode.updateUIDensity(this.mode);"
-                  onmouseover="gCustomizeMode.updateUIDensity(this.mode);"
-                  onblur="gCustomizeMode.resetUIDensity();"
-                  onmouseout="gCustomizeMode.resetUIDensity();"
-                  oncommand="gCustomizeMode.setUIDensity(this.mode);" />
-        <menuitem id="customization-uidensity-menuitem-normal"
-                  class="menuitem-iconic customization-uidensity-menuitem"
-                  role="menuitemradio"
-                  label="&customizeMode.uidensity.menuNormal.label;"
-                  accesskey="&customizeMode.uidensity.menuNormal.accessKey;"
-                  tooltiptext="&customizeMode.uidensity.menuNormal.tooltip;"
-                  tabindex="0"
-                  onfocus="gCustomizeMode.updateUIDensity(this.mode);"
-                  onmouseover="gCustomizeMode.updateUIDensity(this.mode);"
-                  onblur="gCustomizeMode.resetUIDensity();"
-                  onmouseout="gCustomizeMode.resetUIDensity();"
-                  oncommand="gCustomizeMode.setUIDensity(this.mode);" />
+          oncommand="gCustomizeMode.toggleTitlebar(this.checked)" data-l10n-id="customize-mode-titlebar"/>
+<checkbox id="customization-extra-drag-space-checkbox" class="customizationmode-checkbox"
+          data-l10n-id="customize-mode-extra-drag-space"
+          oncommand="gCustomizeMode.toggleDragSpace(this.checked)"/>
+<button id="customization-toolbar-visibility-button" class="customizationmode-button" type="menu" data-l10n-id="customize-mode-toolbars">
+  <menupopup id="customization-toolbar-menu" onpopupshowing="onViewToolbarsPopupShowing(event)"/>
+</button>
+<button id="customization-lwtheme-button" data-l10n-id="customize-mode-lwthemes" class="customizationmode-button" type="menu">
+  <panel type="arrow" id="customization-lwtheme-menu"
+         onpopupshowing="gCustomizeMode.onThemesMenuShowing(event);"
+         position="topcenter bottomleft"
+         flip="none"
+         role="menu">
+    <label id="customization-lwtheme-menu-header" data-l10n-id="customize-mode-lwthemes-my-themes"/>
+    <hbox id="customization-lwtheme-menu-footer">
+      <toolbarbutton class="customization-lwtheme-menu-footeritem"
+                     data-l10n-id="customize-mode-lwthemes-menu-manage"
+                     tabindex="0"
+                     oncommand="gCustomizeMode.openAddonsManagerThemes(event);"/>
+      <toolbarbutton class="customization-lwtheme-menu-footeritem"
+                     data-l10n-id="customize-mode-lwthemes-menu-get-more"
+                     tabindex="0"
+                     oncommand="gCustomizeMode.getMoreThemes(event);"/>
+    </hbox>
+  </panel>
+</button>
+<button id="customization-uidensity-button"
+        data-l10n-id="customize-mode-uidensity"
+        class="customizationmode-button"
+        type="menu">
+  <panel type="arrow" id="customization-uidensity-menu"
+         onpopupshowing="gCustomizeMode.onUIDensityMenuShowing();"
+         position="topcenter bottomleft"
+         flip="none"
+         role="menu">
+    <menuitem id="customization-uidensity-menuitem-compact"
+              class="menuitem-iconic customization-uidensity-menuitem"
+              role="menuitemradio"
+              data-l10n-id="customize-mode-uidensity-menu-compact"
+              tabindex="0"
+              onfocus="gCustomizeMode.updateUIDensity(this.mode);"
+              onmouseover="gCustomizeMode.updateUIDensity(this.mode);"
+              onblur="gCustomizeMode.resetUIDensity();"
+              onmouseout="gCustomizeMode.resetUIDensity();"
+              oncommand="gCustomizeMode.setUIDensity(this.mode);"/>
+    <menuitem id="customization-uidensity-menuitem-normal"
+              class="menuitem-iconic customization-uidensity-menuitem"
+              role="menuitemradio"
+              data-l10n-id="customize-mode-uidensity-menu-normal"
+              tabindex="0"
+              onfocus="gCustomizeMode.updateUIDensity(this.mode);"
+              onmouseover="gCustomizeMode.updateUIDensity(this.mode);"
+              onblur="gCustomizeMode.resetUIDensity();"
+              onmouseout="gCustomizeMode.resetUIDensity();"
+              oncommand="gCustomizeMode.setUIDensity(this.mode);"/>
 #ifndef XP_MACOSX
-        <menuitem id="customization-uidensity-menuitem-touch"
-                  class="menuitem-iconic customization-uidensity-menuitem"
-                  role="menuitemradio"
-                  label="&customizeMode.uidensity.menuTouch.label;"
-                  accesskey="&customizeMode.uidensity.menuTouch.accessKey;"
-                  tooltiptext="&customizeMode.uidensity.menuTouch.tooltip;"
-                  tabindex="0"
-                  onfocus="gCustomizeMode.updateUIDensity(this.mode);"
-                  onmouseover="gCustomizeMode.updateUIDensity(this.mode);"
-                  onblur="gCustomizeMode.resetUIDensity();"
-                  onmouseout="gCustomizeMode.resetUIDensity();"
-                  oncommand="gCustomizeMode.setUIDensity(this.mode);">
-        </menuitem>
-        <spacer hidden="true" id="customization-uidensity-touch-spacer"/>
-        <checkbox id="customization-uidensity-autotouchmode-checkbox"
-                  hidden="true"
-                  label="&customizeMode.uidensity.autoTouchMode.checkbox.label;"
-                  oncommand="gCustomizeMode.updateAutoTouchMode(this.checked)"/>
+    <menuitem id="customization-uidensity-menuitem-touch"
+              class="menuitem-iconic customization-uidensity-menuitem"
+              role="menuitemradio"
+              data-l10n-id="customize-mode-uidensity-menu-touch"
+              tabindex="0"
+              onfocus="gCustomizeMode.updateUIDensity(this.mode);"
+              onmouseover="gCustomizeMode.updateUIDensity(this.mode);"
+              onblur="gCustomizeMode.resetUIDensity();"
+              onmouseout="gCustomizeMode.resetUIDensity();"
+              oncommand="gCustomizeMode.setUIDensity(this.mode);">
+    </menuitem>
+    <spacer hidden="true" id="customization-uidensity-touch-spacer"/>
+    <checkbox id="customization-uidensity-autotouchmode-checkbox"
+              hidden="true"
+              data-l10n-id="customize-mode-uidensity-auto-touch-mode-checkbox"
+              oncommand="gCustomizeMode.updateAutoTouchMode(this.checked)"/>
 #endif
-      </panel>
-    </button>
+  </panel>
+</button>
 
-    <button id="whimsy-button"
-            type="checkbox"
-            class="customizationmode-button"
-            oncommand="gCustomizeMode.togglePong(this.checked);"
-            hidden="true"/>
+<button id="whimsy-button"
+        type="checkbox"
+        class="customizationmode-button"
+        oncommand="gCustomizeMode.togglePong(this.checked);"
+        hidden="true"/>
 
-    <spacer id="customization-footer-spacer"/>
-    <button id="customization-undo-reset-button"
-            class="customizationmode-button"
-            hidden="true"
-            oncommand="gCustomizeMode.undoReset();"
-            label="&undoCmd.label;"/>
-    <button id="customization-reset-button"
-            oncommand="gCustomizeMode.reset();"
-            label="&customizeMode.restoreDefaults;"
-            class="customizationmode-button"/>
-    <button id="customization-done-button"
-            oncommand="gCustomizeMode.exit();"
-            label="&customizeMode.done;"
-            class="customizationmode-button"/>
-  </hbox>
-</box>
+<spacer id="customization-footer-spacer"/>
+<button id="customization-undo-reset-button"
+        class="customizationmode-button"
+        hidden="true"
+        oncommand="gCustomizeMode.undoReset();"
+        data-l10n-id="customize-mode-undo-cmd"/>
+<button id="customization-reset-button"
+        oncommand="gCustomizeMode.reset();"
+        data-l10n-id="customize-mode-restore-defaults"
+        class="customizationmode-button"/>
+<button id="customization-done-button"
+        oncommand="gCustomizeMode.exit();"
+        data-l10n-id="customize-mode-done"
+        class="customizationmode-button"/>
+</hbox>
new file mode 100644
--- /dev/null
+++ b/browser/locales/en-US/browser/customizeMode.ftl
@@ -0,0 +1,45 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+customize-mode-restore-defaults =
+    .label = Restore Defaults
+customize-mode-menu-and-toolbars-header = Drag your favorite items into the toolbar or overflow menu.
+customize-mode-overflow-list-title = Overflow Menu
+customize-mode-uidensity =
+    .label = Density
+customize-mode-done =
+    .label = Done
+customize-mode-lwthemes-menu-manage =
+    .label = Manage
+    .accesskey = M
+customize-mode-toolbars =
+    .label = Toolbars
+customize-mode-titlebar =
+    .label = Title Bar
+customize-mode-uidensity-menu-touch =
+    .label = Touch
+    .accesskey = T
+    .tooltiptext = Touch
+customize-mode-uidensity-auto-touch-mode-checkbox =
+    .label = Use Touch for Tablet Mode
+customize-mode-extra-drag-space =
+    .label = Drag Space
+customize-mode-lwthemes =
+    .label = Themes
+customize-mode-overflow-list-description = Drag and drop items here to keep them within reach but out of your toolbar…
+customize-mode-uidensity-menu-normal =
+    .label = Normal
+    .accesskey = N
+    .tooltiptext = Normal
+customize-mode-uidensity-menu-compact =
+    .label = Compact
+    .accesskey = C
+    .tooltiptext = Compact
+customize-mode-lwthemes-menu-get-more =
+    .label = Get More Themes
+    .accesskey = G
+customize-mode-undo-cmd =
+    .label = Undo
+customize-mode-lwthemes-my-themes =
+    .value = My Themes
--- a/browser/locales/en-US/chrome/browser/browser.dtd
+++ b/browser/locales/en-US/chrome/browser/browser.dtd
@@ -862,51 +862,16 @@ you can use these alternative items. Oth
 <!ENTITY syncSignIn.accesskey         "Y">
 <!ENTITY syncSyncNowItem.label        "Sync Now">
 <!ENTITY syncSyncNowItemSyncing.label "Syncing…">
 <!ENTITY syncSyncNowItem.accesskey    "S">
 <!ENTITY syncReAuthItem.label         "Reconnect to &syncBrand.shortName.label;…">
 <!ENTITY syncReAuthItem.accesskey     "R">
 <!ENTITY syncToolbarButton.label      "Sync">
 
-<!ENTITY customizeMode.menuAndToolbars.header3 "Drag your favorite items into the toolbar or overflow menu.">
-<!ENTITY customizeMode.restoreDefaults "Restore Defaults">
-<!ENTITY customizeMode.done "Done">
-<!ENTITY customizeMode.titlebar "Title Bar">
-<!ENTITY customizeMode.extraDragSpace "Drag Space">
-<!ENTITY customizeMode.toolbars2 "Toolbars">
-<!ENTITY customizeMode.lwthemes "Themes">
-<!ENTITY customizeMode.lwthemes.myThemes "My Themes">
-<!ENTITY customizeMode.lwthemes.menuManage "Manage">
-<!ENTITY customizeMode.lwthemes.menuManage.accessKey "M">
-<!ENTITY customizeMode.lwthemes.menuGetMore "Get More Themes">
-<!ENTITY customizeMode.lwthemes.menuGetMore.accessKey "G">
-<!ENTITY customizeMode.overflowList.title2 "Overflow Menu">
-<!ENTITY customizeMode.overflowList.description "Drag and drop items here to keep them within reach but out of your toolbar…">
-<!ENTITY customizeMode.uidensity "Density">
-<!-- LOCALIZATION NOTE (customizeMode.uidensity.menuNormal.*):
-     “Normal” is displayed in the Customize screen, under the Density menu. -->
-<!ENTITY customizeMode.uidensity.menuNormal.label "Normal">
-<!ENTITY customizeMode.uidensity.menuNormal.tooltip "Normal">
-<!ENTITY customizeMode.uidensity.menuNormal.accessKey "N">
-<!-- LOCALIZATION NOTE (customizeMode.uidensity.menuCompact.*):
-     “Compact” is displayed in the Customize screen, under the Density menu.
-     It’s an adjective (Density -> Compact). -->
-<!ENTITY customizeMode.uidensity.menuCompact.label "Compact">
-<!ENTITY customizeMode.uidensity.menuCompact.tooltip "Compact">
-<!ENTITY customizeMode.uidensity.menuCompact.accessKey "C">
-<!-- LOCALIZATION NOTE (customizeMode.uidensity.menuTouch.*):
-     “Touch” is displayed in the Customize screen, under the Density menu.
-     It’s an adjective (Density -> Touch), and it means that control layout is
-     optimized for touch devices. -->
-<!ENTITY customizeMode.uidensity.menuTouch.label "Touch">
-<!ENTITY customizeMode.uidensity.menuTouch.tooltip "Touch">
-<!ENTITY customizeMode.uidensity.menuTouch.accessKey "T">
-<!ENTITY customizeMode.uidensity.autoTouchMode.checkbox.label "Use Touch for Tablet Mode">
-
 <!ENTITY customizeMode.autoHideDownloadsButton.label "Auto-hide">
 
 <!ENTITY getUserMedia.selectCamera.label "Camera to share:">
 <!ENTITY getUserMedia.selectCamera.accesskey "C">
 <!ENTITY getUserMedia.selectMicrophone.label "Microphone to share:">
 <!ENTITY getUserMedia.selectMicrophone.accesskey "M">
 <!ENTITY getUserMedia.audioCapture.label "Audio from the tab will be shared.">
 <!ENTITY getUserMedia.allWindowsShared.message "All visible windows on your screen will be shared.">
--- a/python/l10n/convert_xul_to_fluent/convert.py
+++ b/python/l10n/convert_xul_to_fluent/convert.py
@@ -56,18 +56,16 @@ def parse_inputs():
     main()
 
 
 def main():
     dry_run = data['dry-run']
     dtds = get_dtds(data['dtd'], data['mozilla-central'])
 
     print('======== DTDs ========')
-    # with open('DTDs.json', 'w') as outfile:
-    #     json.dump(dtds, outfile, sort_keys=True, indent=2)
     print(json.dumps(dtds, sort_keys=True, indent=2))
 
     s = read_file(data['xul'], data['mozilla-central'])
 
     print('======== INPUT ========')
     print(s)
 
     print('======== OUTPUT ========')
--- a/python/l10n/convert_xul_to_fluent/lib/migration.py
+++ b/python/l10n/convert_xul_to_fluent/lib/migration.py
@@ -14,17 +14,17 @@ def get_entity_name(s):
     return s[1:-1]
 
 
 def ind(n=0):
     return ' ' * 4 * n
 
 
 def add_copy(dtd, entity_id):
-    result = '{' + 'COPY("{0}", "{1}")'.format(dtd, entity_id)+' }\n'
+    result = '{ ' + 'COPY("{0}", "{1}")'.format(dtd, entity_id)+' }\n'
     return result
 
 
 def make_header():
     res = '# coding=utf8\n\n'
     res += '# Any copyright is dedicated to the Public Domain.\n'
     res += '# http://creativecommons.org/publicdomain/zero/1.0/\n\n'
     res += 'from __future__ import absolute_import\n'
@@ -44,28 +44,30 @@ def build_migration(messages, dtds, data
     res += '\n\ndef migrate(ctx):\n    """{0}"""\n\n'.format(desc)
 
     for dtd_path in data['dtd']:
         res += "{0}ctx.maybe_add_localization('{1}')\n".format(
             ind(1), to_chrome_path(dtd_path))
 
     res += '\n'
     res += ind(1) + 'ctx.add_transforms(\n'
-    res += ind(2) + '{0},\n'.format(to_chrome_path(data['ftl']))
-    res += ind(2) + '{0},\n'.format(to_chrome_path(data['ftl']))
+    res += ind(2) + "'{0}',\n".format(to_chrome_path(data['ftl']))
+    res += ind(2) + "'{0}',\n".format(to_chrome_path(data['ftl']))
     res += ind(2) + 'transforms_from(\n'
     res += '"""\n'
     for l10n_id in messages:
         msg = messages[l10n_id]
         if not msg['attrs']:
-            res += '{0} = {1}'.format(l10n_id,
-                                      add_copy(get_dtd_path(msg['value'], dtds), msg['value']))
+            entity = get_entity_name(msg['value'])
+            entity_path = to_chrome_path(get_dtd_path(msg['value'], dtds))
+            res += '{0} = {1}'.format(l10n_id, add_copy(entity_path, entity))
         else:
             res += '{0} = \n'.format(l10n_id)
             for name in msg['attrs']:
                 attr = msg['attrs'][name]
-                res += '{0}.{1} = {2}'.format(ind(1),
-                                              name, add_copy(get_dtd_path(attr, dtds), attr))
+                attr_name = get_entity_name(attr)
+                entity_path = to_chrome_path(get_dtd_path(attr, dtds))
+                res += '{0}.{1} = {2}'.format(ind(1), name, add_copy(entity_path, attr_name))
     res += '"""\n'
     res += ind(2) + ')\n'
     res += ind(1) + ')'
 
     return res
--- a/python/l10n/convert_xul_to_fluent/lib/xul.py
+++ b/python/l10n/convert_xul_to_fluent/lib/xul.py
@@ -1,10 +1,11 @@
 from __future__ import absolute_import
 import re
+import string
 
 tag_re = r'<([a-z]+[^>/]*)(/?>)([^<]*)(?:</[a-z]+>)?'
 attr_re = r'\s+([a-z]+)="([\&\;\.a-zA-Z0-9]+)"'
 prefix = ""
 
 messages = {}
 
 
@@ -16,23 +17,26 @@ def convert_camel_case(name):
     s1 = re.sub('(.)([A-Z][a-z]+)', r'\1-\2', name)
     return re.sub('([a-z0-9])([A-Z])', r'\1-\2', s1).lower()
 
 
 def construct_l10n_id(val, attrs):
     global prefix
     id = None
     if val:
-        id = val[1:-1]
+        id = val[1:-1].strip(string.digits)
     else:
         core = None
         for k in attrs:
-            v = attrs[k][1:-1].split('.')
+            v = attrs[k][1:-1].strip(string.digits).split('.')
             if not core:
-                core = v[0]
+                if v[-1].lower() == k:
+                    core = '.'.join(v[:-1])
+                else:
+                    core = '.'.join(v)
         if core:
             id = core
     id = id.replace('.', '-')
     id = convert_camel_case(id)
     if prefix:
         id = "{}-{}".format(prefix, id)
     return id
 
@@ -55,17 +59,16 @@ def tagrepl(m):
 
     def attrrepl(m2):
         global vector
         global is_l10n
         attr_l10n = False
         if is_entity(m2.group(2)):
             attr_l10n = True
             l10n_attrs[m2.group(1)] = m2.group(2)
-
         if attr_l10n:
             is_l10n = True
             vector = vector + len(m2.group(0))
             return ""
         return m2.group(0)
 
     tag = re.sub(attr_re, attrrepl, m.group(0))
     if is_l10n:
new file mode 100644
--- /dev/null
+++ b/python/l10n/fluent_migrations/bug_1523747_customizeMode.py
@@ -0,0 +1,63 @@
+# coding=utf8
+# Any copyright is dedicated to the Public Domain.
+# http://creativecommons.org/publicdomain/zero/1.0/
+
+from __future__ import absolute_import
+import fluent.syntax.ast as FTL
+from fluent.migrate.helpers import transforms_from
+from fluent.migrate.helpers import MESSAGE_REFERENCE, TERM_REFERENCE, VARIABLE_REFERENCE
+from fluent.migrate import COPY, CONCAT, REPLACE
+
+def migrate(ctx):
+    """Bug 1523747 - Migrate customizeMode strings to Fluent, part {index}"""
+    ctx.maybe_add_localization('browser/chrome/browser/browser.dtd')
+    ctx.add_transforms(
+        'browser/browser/customizeMode.ftl',
+        'browser/browser/customizeMode.ftl',
+        transforms_from(
+"""
+customize-mode-restore-defaults = 
+    .label = { COPY("browser/chrome/browser/browser.dtd", "customizeMode.restoreDefaults") }
+customize-mode-menu-and-toolbars-header = { COPY("browser/chrome/browser/browser.dtd", "customizeMode.menuAndToolbars.header3") }
+customize-mode-overflow-list-title = { COPY("browser/chrome/browser/browser.dtd", "customizeMode.overflowList.title2") }
+customize-mode-uidensity = 
+    .label = { COPY("browser/chrome/browser/browser.dtd", "customizeMode.uidensity") }
+customize-mode-done = 
+    .label = { COPY("browser/chrome/browser/browser.dtd", "customizeMode.done") }
+customize-mode-lwthemes-menu-manage = 
+    .label = { COPY("browser/chrome/browser/browser.dtd", "customizeMode.lwthemes.menuManage") }
+    .accesskey = { COPY("browser/chrome/browser/browser.dtd", "customizeMode.lwthemes.menuManage.accessKey") }
+customize-mode-toolbars = 
+    .label = { COPY("browser/chrome/browser/browser.dtd", "customizeMode.toolbars2") }
+customize-mode-titlebar = 
+    .label = { COPY("browser/chrome/browser/browser.dtd", "customizeMode.titlebar") }
+customize-mode-uidensity-menu-touch = 
+    .label = { COPY("browser/chrome/browser/browser.dtd", "customizeMode.uidensity.menuTouch.label") }
+    .accesskey = { COPY("browser/chrome/browser/browser.dtd", "customizeMode.uidensity.menuTouch.accessKey") }
+    .tooltiptext = { COPY("browser/chrome/browser/browser.dtd", "customizeMode.uidensity.menuTouch.tooltip") }
+customize-mode-uidensity-auto-touch-mode-checkbox = 
+    .label = { COPY("browser/chrome/browser/browser.dtd", "customizeMode.uidensity.autoTouchMode.checkbox.label") }
+customize-mode-extra-drag-space = 
+    .label = { COPY("browser/chrome/browser/browser.dtd", "customizeMode.extraDragSpace") }
+customize-mode-lwthemes = 
+    .label = { COPY("browser/chrome/browser/browser.dtd", "customizeMode.lwthemes") }
+customize-mode-overflow-list-description = { COPY("browser/chrome/browser/browser.dtd", "customizeMode.overflowList.description") }
+customize-mode-uidensity-menu-normal = 
+    .label = { COPY("browser/chrome/browser/browser.dtd", "customizeMode.uidensity.menuNormal.label") }
+    .accesskey = { COPY("browser/chrome/browser/browser.dtd", "customizeMode.uidensity.menuNormal.accessKey") }
+    .tooltiptext = { COPY("browser/chrome/browser/browser.dtd", "customizeMode.uidensity.menuNormal.tooltip") }
+customize-mode-uidensity-menu-compact = 
+    .label = { COPY("browser/chrome/browser/browser.dtd", "customizeMode.uidensity.menuCompact.label") }
+    .accesskey = { COPY("browser/chrome/browser/browser.dtd", "customizeMode.uidensity.menuCompact.accessKey") }
+    .tooltiptext = { COPY("browser/chrome/browser/browser.dtd", "customizeMode.uidensity.menuCompact.tooltip") }
+customize-mode-lwthemes-menu-get-more = 
+    .label = { COPY("browser/chrome/browser/browser.dtd", "customizeMode.lwthemes.menuGetMore") }
+    .accesskey = { COPY("browser/chrome/browser/browser.dtd", "customizeMode.lwthemes.menuGetMore.accessKey") }
+customize-mode-undo-cmd = 
+    .label = { COPY("browser/chrome/browser/browser.dtd", "undoCmd.label") }
+customize-mode-lwthemes-my-themes = 
+    .value = { COPY("browser/chrome/browser/browser.dtd", "customizeMode.lwthemes.myThemes") }
+"""
+        )
+    )
+