From a23d23117d2bef6876d939948c0bbb20dbc5be65 Mon Sep 17 00:00:00 2001 From: Eemeli Aro Date: Mon, 15 Aug 2022 11:45:03 +0000 Subject: [PATCH] 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 --- .../bug_1731353_commonDialog.py | 30 +++++++++++++++++++ .../prompts/content/commonDialog.xhtml | 8 ++--- .../prompts/content/selectDialog.xhtml | 2 +- .../en-US/chrome/global/commonDialog.dtd | 4 --- .../en-US/toolkit/global/commonDialog.ftl | 7 +++++ 5 files changed, 41 insertions(+), 10 deletions(-) create mode 100644 python/l10n/fluent_migrations/bug_1731353_commonDialog.py diff --git a/python/l10n/fluent_migrations/bug_1731353_commonDialog.py b/python/l10n/fluent_migrations/bug_1731353_commonDialog.py new file mode 100644 index 000000000000..74e9f17e89da --- /dev/null +++ b/python/l10n/fluent_migrations/bug_1731353_commonDialog.py @@ -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", + ), + ) diff --git a/toolkit/components/prompts/content/commonDialog.xhtml b/toolkit/components/prompts/content/commonDialog.xhtml index ca35edf67b9b..f9e378adda38 100644 --- a/toolkit/components/prompts/content/commonDialog.xhtml +++ b/toolkit/components/prompts/content/commonDialog.xhtml @@ -8,7 +8,7 @@ - + diff --git a/toolkit/components/prompts/content/selectDialog.xhtml b/toolkit/components/prompts/content/selectDialog.xhtml index 3d1f0e740091..877e0e71403a 100644 --- a/toolkit/components/prompts/content/selectDialog.xhtml +++ b/toolkit/components/prompts/content/selectDialog.xhtml @@ -5,7 +5,7 @@ - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> - + diff --git a/toolkit/locales/en-US/chrome/global/commonDialog.dtd b/toolkit/locales/en-US/chrome/global/commonDialog.dtd index c5ceea07bfc3..daa6ac034180 100644 --- a/toolkit/locales/en-US/chrome/global/commonDialog.dtd +++ b/toolkit/locales/en-US/chrome/global/commonDialog.dtd @@ -4,7 +4,3 @@ - - - - diff --git a/toolkit/locales/en-US/toolkit/global/commonDialog.ftl b/toolkit/locales/en-US/toolkit/global/commonDialog.ftl index b76ec85a5a6d..1629a0d3330c 100644 --- a/toolkit/locales/en-US/toolkit/global/commonDialog.ftl +++ b/toolkit/locales/en-US/toolkit/global/commonDialog.ftl @@ -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