Bug 1731353 - Migrate commonDialog strings from DTD to FTL. r=fluent-reviewers,mossop,flod

This migrates only the strings used by commonDialog.xhtml

Differential Revision: https://phabricator.services.mozilla.com/D154422
This commit is contained in:
Eemeli Aro 2022-08-15 06:07:32 +00:00
Родитель 4bdb2927d4
Коммит efbe90cdd8
5 изменённых файлов: 41 добавлений и 10 удалений

Просмотреть файл

@ -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 1731353 - Migrate commonDialog strings from DTD to FTL, part {index}"""
ctx.add_transforms(
"toolkit/toolkit/global/commonDialog.ftl",
"toolkit/toolkit/global/commonDialog.ftl",
transforms_from(
"""
common-dialog-copy-cmd =
.label = { COPY(path1, "copyCmd.label") }
.accesskey = { COPY(path1, "copyCmd.accesskey") }
common-dialog-select-all-cmd =
.label = { COPY(path1, "selectAllCmd.label") }
.accesskey = { COPY(path1, "selectAllCmd.accesskey") }
""",
path1="toolkit/chrome/global/commonDialog.dtd",
),
)

Просмотреть файл

@ -8,7 +8,7 @@
<?xml-stylesheet href="chrome://global/content/commonDialog.css" type="text/css"?>
<?xml-stylesheet href="chrome://global/skin/commonDialog.css" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://global/locale/commonDialog.dtd">
<!DOCTYPE window>
<window id="commonDialogWindow"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
@ -45,13 +45,11 @@
<menupopup id="contentAreaContextMenu"
onpopupshowing="goUpdateCommand('cmd_copy')">
<menuitem id="context-copy"
label="&copyCmd.label;"
accesskey="&copyCmd.accesskey;"
data-l10n-id="common-dialog-copy-cmd"
command="cmd_copy"
disabled="true"/>
<menuitem id="context-selectall"
label="&selectAllCmd.label;"
accesskey="&selectAllCmd.accesskey;"
data-l10n-id="common-dialog-select-all-cmd"
command="cmd_selectAll"/>
</menupopup>
</popupset>

Просмотреть файл

@ -5,7 +5,7 @@
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://global/locale/commonDialog.dtd">
<!DOCTYPE window>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<dialog>

Просмотреть файл

@ -4,7 +4,3 @@
<!ENTITY editfield0.label "User Name:">
<!ENTITY editfield1.label "Password:">
<!ENTITY copyCmd.label "Copy">
<!ENTITY copyCmd.accesskey "C">
<!ENTITY selectAllCmd.label "Select All">
<!ENTITY selectAllCmd.accesskey "A">

Просмотреть файл

@ -11,3 +11,10 @@ common-dialog-username =
.value = Username
common-dialog-password =
.value = Password
common-dialog-copy-cmd =
.label = Copy
.accesskey = C
common-dialog-select-all-cmd =
.label = Select All
.accesskey = A