From 6bf0a5cb5034a7e684dcc3500e841785237ce2dd Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 19:32:43 +0200 Subject: Adding upstream version 1:115.7.0. Signed-off-by: Daniel Baumann --- .../bug_1816532_about_dialog_migration.py | 94 ++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 comm/python/l10n/tb_fluent_migrations/completed/bug_1816532_about_dialog_migration.py (limited to 'comm/python/l10n/tb_fluent_migrations/completed/bug_1816532_about_dialog_migration.py') diff --git a/comm/python/l10n/tb_fluent_migrations/completed/bug_1816532_about_dialog_migration.py b/comm/python/l10n/tb_fluent_migrations/completed/bug_1816532_about_dialog_migration.py new file mode 100644 index 0000000000..cc47261099 --- /dev/null +++ b/comm/python/l10n/tb_fluent_migrations/completed/bug_1816532_about_dialog_migration.py @@ -0,0 +1,94 @@ +# coding=utf8 + +# Any copyright is dedicated to the Public Domain. +# http://creativecommons.org/publicdomain/zero/1.0/ + + +from fluent.migratetb.helpers import TERM_REFERENCE +from fluent.migratetb.helpers import transforms_from + + +# This can't just be a straight up literal dict (eg: {"a":"b"}) because the +# validator fails... so make it a function call that returns a dict.. it works +about_replacements = dict( + { + "&brandShorterName;": TERM_REFERENCE("brand-shorter-name"), + "&brandShortName;": TERM_REFERENCE("brand-short-name"), + "&vendorShortName;": TERM_REFERENCE("vendor-short-name"), + } +) + + +def migrate(ctx): + """Bug 1816532 - Migrate aboutDialog.dtd strings to Fluent, part {index}""" + target = reference = "mail/messenger/aboutDialog.ftl" + source = "mail/chrome/messenger/aboutDialog.dtd" + + ctx.add_transforms( + target, + reference, + transforms_from( + """ +release-notes-link = { COPY(source, "releaseNotes.link") } + +update-check-for-updates-button = { COPY(source, "update.checkForUpdatesButton.label") } + .accesskey = { COPY(source, "update.checkForUpdatesButton.accesskey") } + +update-update-button = { REPLACE(source, "update.updateButton.label3", about_replacements) } + .accesskey = { COPY(source, "update.updateButton.accesskey") } + +update-checking-for-updates = { COPY(source, "update.checkingForUpdates") } + +update-downloading-message = { COPY(source, "update.downloading.start") } + +update-applying = { COPY(source, "update.applying") } + +update-downloading = { COPY(source, "update.downloading.start") } + +update-failed = { COPY(source, "update.failed.start") }{ COPY(source, "update.failed.linkText") } + +update-admin-disabled = { COPY(source, "update.adminDisabled") } + +update-no-updates-found = { REPLACE(source, "update.noUpdatesFound", about_replacements) } + +update-other-instance-handling-updates = { REPLACE(source, "update.otherInstanceHandlingUpdates", about_replacements) } + +update-unsupported = { COPY(source, "update.unsupported.start") }{ COPY(source, "update.unsupported.linkText") } + +update-restarting = { COPY(source, "update.restarting") } + +channel-description = { COPY(source, "channel.description.start") }{ $channel } { COPY(source, "channel.description.end", trim: "True") } + +warning-desc-version = { REPLACE(source, "warningDesc.version", about_replacements) } + +warning-desc-telemetry = { REPLACE(source, "warningDesc.telemetryDesc", about_replacements) } + +community-exp = + { REPLACE(source, "community.exp.mozillaLink", about_replacements) } + { COPY(source, "community.exp.middle") } + { COPY(source, "community.exp.creditsLink") } + { COPY(source, "community.exp.end") } + +community-2 = { REPLACE(source, "community.start2", about_replacements) } + { REPLACE(source, "community.mozillaLink", about_replacements) } + { COPY(source, "community.middle2") } + { COPY(source, "community.creditsLink") } + { COPY(source, "community.end3") } + +about-helpus = { COPY(source, "helpus.start") } + { COPY(source, "helpus.donateLink") } or + { COPY(source, "helpus.getInvolvedLink") } + +bottom-links-license = { COPY(source, "bottomLinks.license") } + +bottom-links-rights = { COPY(source, "bottomLinks.rights") } + +bottom-links-privacy = { COPY(source, "bottomLinks.privacy") } + +cmd-close-mac-command-key = + .key = { COPY(source, "cmdCloseMac.commandKey") } +""", + source=source, + about_replacements=about_replacements, + ), + ) -- cgit v1.2.3