Skip to content

Commit

Permalink
Bug 1786055 - Migrate styleeditor DTD localization to Fluent. r=nchev…
Browse files Browse the repository at this point in the history
…obbe,fluent-reviewers,flod

After the preceding change, the editMenuOverlay strings are only used by the styleeditor.
Therefore it makes sense to migrate them here specifically to its localization file.

Differential Revision: https://phabricator.services.mozilla.com/D155449
  • Loading branch information
eemeli committed Aug 26, 2022
1 parent 7fc8bee commit fc7b795
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 21 deletions.
6 changes: 6 additions & 0 deletions devtools/client/locales/en-US/styleeditor.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ styleeditor-open-link-new-tab =
.label = Open Link in New Tab
styleeditor-copy-url =
.label = Copy URL
styleeditor-find =
.label = Find
.accesskey = F
styleeditor-find-again =
.label = Find Again
.accesskey = g
styleeditor-go-to-line =
.label = Jump to Line…
.accesskey = J
Expand Down
11 changes: 4 additions & 7 deletions devtools/client/styleeditor/index.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@
<!-- 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/. -->
<!DOCTYPE window [
<!ENTITY % editMenuStrings SYSTEM "chrome://global/locale/editMenuOverlay.dtd">
%editMenuStrings;
]>
<!DOCTYPE window>

<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
<?xml-stylesheet href="chrome://devtools/content/shared/widgets/widgets.css" type="text/css"?>
Expand Down Expand Up @@ -61,9 +58,9 @@
data-l10n-id="text-action-select-all" command="cmd_selectAll"/>
<menuseparator/>
<menuitem id="se-menu-find"
label="&findCmd.label;" accesskey="&findCmd.accesskey;" command="cmd_find"/>
<menuitem id="cMenu_findAgain" label="&findAgainCmd.label;"
accesskey="&findAgainCmd.accesskey;" command="cmd_findAgain"/>
data-l10n-id="styleeditor-find" command="cmd_find"/>
<menuitem id="cMenu_findAgain"
data-l10n-id="styleeditor-find-again" command="cmd_findAgain"/>
<menuseparator/>
<menuitem id="se-menu-gotoLine"
data-l10n-id="styleeditor-go-to-line"
Expand Down
30 changes: 30 additions & 0 deletions python/l10n/fluent_migrations/bug_1786055_migration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# 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 COPY


def migrate(ctx):
"""Bug 1786055 - Migrate styleeditor from DTD to Fluent, part {index}"""

ctx.add_transforms(
"devtools/client/styleeditor.ftl",
"devtools/client/styleeditor.ftl",
transforms_from(
"""
styleeditor-find =
.label = { COPY(path1, "findCmd.label") }
.accesskey = { COPY(path1, "findCmd.accesskey") }
styleeditor-find-again =
.label = { COPY(path1, "findAgainCmd.label") }
.accesskey = { COPY(path1, "findAgainCmd.accesskey") }
""",
path1="toolkit/chrome/global/editMenuOverlay.dtd",
),
)
11 changes: 0 additions & 11 deletions toolkit/locales/en-US/chrome/global/editMenuOverlay.dtd

This file was deleted.

3 changes: 0 additions & 3 deletions toolkit/locales/jar.mn
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
locale/@AB_CD@/global/browser.properties (%chrome/global/browser.properties)
locale/@AB_CD@/global/commonDialogs.properties (%chrome/global/commonDialogs.properties)
locale/@AB_CD@/global/contentAreaCommands.properties (%chrome/global/contentAreaCommands.properties)
#ifndef MOZ_FENNEC
locale/@AB_CD@/global/editMenuOverlay.dtd (%chrome/global/editMenuOverlay.dtd)
#endif
locale/@AB_CD@/global/extensions.properties (%chrome/global/extensions.properties)
locale/@AB_CD@/global/fallbackMenubar.properties (%chrome/global/fallbackMenubar.properties)
locale/@AB_CD@/global/filepicker.properties (%chrome/global/filepicker.properties)
Expand Down

0 comments on commit fc7b795

Please sign in to comment.