Skip to content

Commit

Permalink
Bug 1787411 - Migrate layout debugger localization to Fluent. r=fluen…
Browse files Browse the repository at this point in the history
…t-reviewers,flod,emilio

The localization file is moved to `content/` to make it more clear that it's not intended to be localised.

For the same reason, no Fluent migration script is included as there are no localised strings to migrate.

Differential Revision: https://phabricator.services.mozilla.com/D155702
  • Loading branch information
eemeli committed Aug 29, 2022
1 parent 3849b3a commit 24830b1
Show file tree
Hide file tree
Showing 6 changed files with 114 additions and 87 deletions.
81 changes: 81 additions & 0 deletions layout/tools/layout-debug/ui/content/layoutdebug.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# 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/.

### This file is not in a locales directory to prevent it from being
### translated as the layout debugger is only available in debug builds.

layoutdebug-main-window =
.title = Layout Debugger
layoutdebug-back-button =
.label = Back
layoutdebug-forward-button =
.label = Forward
layoutdebug-reload-button =
.label = Reload
layoutdebug-stop-button =
.label = Stop
## Toggle Menu

layoutdebug-toggle-menu =
.label = Toggle
.accesskey = T
layoutdebug-paint-dumping =
.label = Paint Dumping
.accesskey = P
layoutdebug-invalidate-dumping =
.label = Invalidate Dumping
.accesskey = I
layoutdebug-event-dumping =
.label = Event Dumping
.accesskey = E
layoutdebug-motion-event-dumping =
.label = Motion Event Dumping
.accesskey = M
layoutdebug-crossing-event-dumping =
.label = Crossing Event Dumping
.accesskey = C
layoutdebug-reflow-counts =
.label = Reflow Counts
.accesskey = R
layoutdebug-paged-mode =
.label = Paged Mode
.accesskey = g
## Dump Menu

layoutdebug-dump-menu =
.label = Dump
.accesskey = D
layoutdebug-dump-content =
.label = Content
.accesskey = C
layoutdebug-dump-frames =
.label = Frames (app units)
.accesskey = F
layoutdebug-dump-frames-in-css-pixels =
.label = Frames (CSS pixels)
.accesskey = p
layoutdebug-dump-text-runs =
.label = Text Runs
.accesskey = T
layoutdebug-dump-views =
.label = Views and Widgets
.accesskey = V
layoutdebug-dump-counter-manager =
.label = CSS Counters
.accesskey = n
layoutdebug-dump-style-sheets =
.label = Style Sheets
.accesskey = S
layoutdebug-dump-matched-rules =
.label = Matched CSS Rules
.accesskey = M
layoutdebug-dump-computed-styles =
.label = Style Contexts
.accesskey = x
layoutdebug-dump-reflow-stats =
.label = Reflow Statistics
.accesskey = R
58 changes: 29 additions & 29 deletions layout/tools/layout-debug/ui/content/layoutdebug.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
- 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/. -->

<!DOCTYPE window SYSTEM "chrome://layoutdebug/locale/layoutdebug.dtd">
<!DOCTYPE window>

<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css" ?>

Expand All @@ -23,9 +23,7 @@
xmlns:html="http://www.w3.org/1999/xhtml"
id="main-window"
align="stretch"
title="&ldb.MainWindow.title;"
titlemodifier="&ldb.MainWindow.title;"
titlemenuseparator=""
data-l10n-id="layoutdebug-main-window"
windowtype="mozapp:layoutdebug"
onload="OnLDBLoad();"
onclose="OnLDBBeforeUnload(event);"
Expand All @@ -34,6 +32,10 @@
screenX="4" screenY="4"
>

<linkset>
<html:link rel="localization" href="layoutdebug/layoutdebug.ftl"/>
</linkset>

<script src="chrome://layoutdebug/content/layoutdebug.js"/>

<commandset id="tasksCommands">
Expand Down Expand Up @@ -71,36 +73,34 @@
<menuitem id="menu_close" label="Close" accesskey="C" key="key_close" command="cmd_close"/>
</menupopup>
</menu>
<menu label="&ldb.ToggleMenu.label;"
accesskey="&ldb.ToggleMenu.accesskey;">
<menu data-l10n-id="layoutdebug-toggle-menu">
<menupopup>
<menuitem type="checkbox" id="menu_paintDumping" label="&ldb.paintDumping.label;" accesskey="&ldb.paintDumping.accesskey;" oncommand="toggle(this);" />
<menuitem type="checkbox" id="menu_invalidateDumping" label="&ldb.invalidateDumping.label;" accesskey="&ldb.invalidateDumping.accesskey;" oncommand="toggle(this);" />
<menuitem type="checkbox" id="menu_paintDumping" data-l10n-id="layoutdebug-paint-dumping" oncommand="toggle(this);" />
<menuitem type="checkbox" id="menu_invalidateDumping" data-l10n-id="layoutdebug-invalidate-dumping" oncommand="toggle(this);" />
<menuseparator />
<menuitem type="checkbox" id="menu_eventDumping" label="&ldb.eventDumping.label;" accesskey="&ldb.eventDumping.accesskey;" oncommand="toggle(this);" />
<menuitem type="checkbox" id="menu_motionEventDumping" label="&ldb.motionEventDumping.label;" accesskey="&ldb.motionEventDumping.accesskey;" oncommand="toggle(this);" />
<menuitem type="checkbox" id="menu_crossingEventDumping" label="&ldb.crossingEventDumping.label;" accesskey="&ldb.crossingEventDumping.accesskey;" oncommand="toggle(this);" />
<menuitem type="checkbox" id="menu_eventDumping" data-l10n-id="layoutdebug-event-dumping" oncommand="toggle(this);" />
<menuitem type="checkbox" id="menu_motionEventDumping" data-l10n-id="layoutdebug-motion-event-dumping" oncommand="toggle(this);" />
<menuitem type="checkbox" id="menu_crossingEventDumping" data-l10n-id="layoutdebug-crossing-event-dumping" oncommand="toggle(this);" />
<menuseparator />
<menuitem type="checkbox" id="menu_reflowCounts" label="&ldb.reflowCounts.label;" accesskey="&ldb.reflowCounts.accesskey;" oncommand="toggle(this);" />
<menuitem type="checkbox" id="menu_pagedMode" label="&ldb.pagedMode.label;" accesskey="&ldb.pagedMode.accesskey;" oncommand="toggle(this);" />
<menuitem type="checkbox" id="menu_reflowCounts" data-l10n-id="layoutdebug-reflow-counts" oncommand="toggle(this);" />
<menuitem type="checkbox" id="menu_pagedMode" data-l10n-id="layoutdebug-paged-mode" oncommand="toggle(this);" />
</menupopup>
</menu>
<menu label="&ldb.DumpMenu.label;"
accesskey="&ldb.DumpMenu.accesskey;">
<menu data-l10n-id="layoutdebug-dump-menu">
<menupopup>
<menuitem id="menu_processIDs" label="Process IDs" accesskey="P" oncommand="gDebugger.dumpProcessIDs();" />
<menuitem id="menu_dumpContent" label="&ldb.dumpContent.label;" accesskey="&ldb.dumpContent.accesskey;" oncommand="gDebugger.dumpContent();" />
<menuitem id="menu_dumpFrames" label="&ldb.dumpFrames.label;" accesskey="&ldb.dumpFrames.accesskey;" oncommand="gDebugger.dumpFrames();" />
<menuitem id="menu_dumpFramesInCSSPixels" label="&ldb.dumpFramesInCSSPixels.label;" accesskey="&ldb.dumpFramesInCSSPixels.accesskey;" oncommand="gDebugger.dumpFramesInCSSPixels();" />
<menuitem id="menu_dumpTextRuns" label="&ldb.dumpTextRuns.label;" accesskey="&ldb.dumpTextRuns.accesskey;" oncommand="gDebugger.dumpTextRuns();" />
<menuitem id="menu_dumpViews" label="&ldb.dumpViews.label;" accesskey="&ldb.dumpViews.accesskey;" oncommand="gDebugger.dumpViews();" />
<menuitem id="menu_dumpCounterManager" label="&ldb.dumpCounterManager.label;" accesskey="&ldb.dumpCounterManager.accesskey;" oncommand="gDebugger.dumpCounterManager();" />
<menuitem id="menu_dumpContent" data-l10n-id="layoutdebug-dump-content" oncommand="gDebugger.dumpContent();" />
<menuitem id="menu_dumpFrames" data-l10n-id="layoutdebug-dump-frames" oncommand="gDebugger.dumpFrames();" />
<menuitem id="menu_dumpFramesInCSSPixels" data-l10n-id="layoutdebug-dump-frames-in-css-pixels" oncommand="gDebugger.dumpFramesInCSSPixels();" />
<menuitem id="menu_dumpTextRuns" data-l10n-id="layoutdebug-dump-text-runs" oncommand="gDebugger.dumpTextRuns();" />
<menuitem id="menu_dumpViews" data-l10n-id="layoutdebug-dump-views" oncommand="gDebugger.dumpViews();" />
<menuitem id="menu_dumpCounterManager" data-l10n-id="layoutdebug-dump-counter-manager" oncommand="gDebugger.dumpCounterManager();" />
<menuseparator />
<menuitem id="menu_dumpStyleSheets" label="&ldb.dumpStyleSheets.label;" accesskey="&ldb.dumpStyleSheets.accesskey;" oncommand="gDebugger.dumpStyleSheets();" />
<menuitem id="menu_dumpMatchedRules" label="&ldb.dumpMatchedRules.label;" accesskey="&ldb.dumpMatchedRules.accesskey;" oncommand="gDebugger.dumpMatchedRules();" />
<menuitem id="menu_dumpComputedStyles" label="&ldb.dumpComputedStyles.label;" accesskey="&ldb.dumpComputedStyles.accesskey;" oncommand="gDebugger.dumpComputedStyles();" />
<menuitem id="menu_dumpStyleSheets" data-l10n-id="layoutdebug-dump-style-sheets" oncommand="gDebugger.dumpStyleSheets();" />
<menuitem id="menu_dumpMatchedRules" data-l10n-id="layoutdebug-dump-matched-rules" oncommand="gDebugger.dumpMatchedRules();" />
<menuitem id="menu_dumpComputedStyles" data-l10n-id="layoutdebug-dump-computed-styles" oncommand="gDebugger.dumpComputedStyles();" />
<menuseparator />
<menuitem id="menu_dumpReflowStats" label="&ldb.dumpReflowStats.label;" accesskey="&ldb.dumpReflowStats.accesskey;" oncommand="gDebugger.dumpReflowStats();" />
<menuitem id="menu_dumpReflowStats" data-l10n-id="layoutdebug-dump-reflow-stats" oncommand="gDebugger.dumpReflowStats();" />
</menupopup>
</menu>
<menu id="tasksMenu"/>
Expand All @@ -111,16 +111,16 @@

<toolbar>
<toolbarbutton id="back-button" class="toolbarbutton-1"
label="&ldb.BackButton.label;"
data-l10n-id="layoutdebug-back-button"
oncommand="gBrowser.goBack();" />
<toolbarbutton id="forward-button" class="toolbarbutton-1"
label="&ldb.ForwardButton.label;"
data-l10n-id="layoutdebug-forward-button"
oncommand="gBrowser.goForward();" />
<toolbarbutton id="reload-button" class="toolbarbutton-1"
label="&ldb.ReloadButton.label;"
data-l10n-id="layoutdebug-reload-button"
command="cmd_reload" />
<toolbarbutton id="stop-button" class="toolbarbutton-1"
label="&ldb.StopButton.label;"
data-l10n-id="layoutdebug-stop-button"
oncommand="gBrowser.stop();" />

<html:input id="urlbar" style="-moz-box-flex: 1;" onkeypress="if (event.keyCode == 13) go();"/>
Expand Down
2 changes: 0 additions & 2 deletions layout/tools/layout-debug/ui/jar.mn
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,5 @@

layoutdebug.jar:
% content layoutdebug %content/layoutdebug/
% locale layoutdebug en-US %locale/en-US/layoutdebug/
content/layoutdebug/layoutdebug.xhtml (content/layoutdebug.xhtml)
content/layoutdebug/layoutdebug.js (content/layoutdebug.js)
locale/en-US/layoutdebug/layoutdebug.dtd (locale/en-US/layoutdebug.dtd)
55 changes: 0 additions & 55 deletions layout/tools/layout-debug/ui/locale/en-US/layoutdebug.dtd

This file was deleted.

3 changes: 3 additions & 0 deletions toolkit/locales/jar.mn
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
[localization] @[email protected]:
crashreporter (%crashreporter/**/*.ftl)
toolkit (%toolkit/**/*.ftl)
#ifdef MOZ_LAYOUT_DEBUGGER
layoutdebug/layoutdebug.ftl (../../layout/tools/layout-debug/ui/content/layoutdebug.ftl)
#endif

@[email protected]:
% locale global @AB_CD@ %locale/@AB_CD@/global/
Expand Down
2 changes: 1 addition & 1 deletion tools/lint/codespell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ codespell:
- intl/docs/
- intl/locales/en-US/
- js/src/doc/
- layout/tools/layout-debug/ui/locale/en-US/
- layout/tools/layout-debug/ui/content/layoutdebug.ftl
- mobile/android/branding/
- mobile/android/docs/
- mobile/android/locales/en-US/
Expand Down

0 comments on commit 24830b1

Please sign in to comment.