# 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, ), )