Bug 1829389 - Remove Fluent migration recipes for Firefox 108-112, r=bolsson DONTBUILD

Differential Revision: https://phabricator.services.mozilla.com/D176151
This commit is contained in:
Francesco Lodolo (:flod) 2023-04-21 16:31:41 +00:00
parent 1da94fcafd
commit 2d6ef69430
14 changed files with 0 additions and 1115 deletions

View File

@ -1,35 +0,0 @@
# coding=utf8
# Any copyright is dedicated to the Public Domain.
# http://creativecommons.org/publicdomain/zero/1.0/
from fluent.migrate.helpers import transforms_from
from fluent.migrate import COPY_PATTERN
def migrate(ctx):
"""Bug 1347955 - Move the logging sub-page of about:networking to about:logging, part {index}"""
ctx.add_transforms(
"toolkit/toolkit/about/aboutLogging.ftl",
"toolkit/toolkit/about/aboutLogging.ftl",
transforms_from(
"""
about-logging-current-log-file =
{COPY_PATTERN(from_path, "about-networking-current-log-file")}
about-logging-current-log-modules =
{COPY_PATTERN(from_path, "about-networking-current-log-modules")}
about-logging-set-log-file =
{COPY_PATTERN(from_path, "about-networking-set-log-file")}
about-logging-set-log-modules =
{COPY_PATTERN(from_path, "about-networking-set-log-modules")}
about-logging-start-logging =
{COPY_PATTERN(from_path, "about-networking-start-logging")}
about-logging-stop-logging =
{COPY_PATTERN(from_path, "about-networking-stop-logging")}
about-logging-log-tutorial =
{COPY_PATTERN(from_path, "about-networking-log-tutorial")}
""",
from_path="toolkit/toolkit/about/aboutNetworking.ftl",
),
)

View File

@ -1,22 +0,0 @@
# coding=utf8
# Any copyright is dedicated to the Public Domain.
# http://creativecommons.org/publicdomain/zero/1.0/
from fluent.migrate.helpers import transforms_from
from fluent.migrate import COPY_PATTERN
def migrate(ctx):
"""Bug 1577257 - Share logic behind panel headers across the UI, part {index}"""
ctx.add_transforms(
"browser/browser/appmenu.ftl",
"browser/browser/appmenu.ftl",
transforms_from(
"""
profiler-popup-header-text =
{ COPY_PATTERN(from_path, "profiler-popup-title.value") }
""",
from_path="browser/browser/appmenu.ftl",
),
)

View File

@ -1,399 +0,0 @@
# Any copyright is dedicated to the Public Domain.
# http://creativecommons.org/publicdomain/zero/1.0/
import fluent.syntax.ast as FTL
from fluent.migrate.helpers import TERM_REFERENCE, VARIABLE_REFERENCE
from fluent.migrate.transforms import COPY, PLURALS, REPLACE, REPLACE_IN_TEXT, Transform
def migrate(ctx):
"""Bug 1760029 - Migrate tabbrowser to Fluent, part {index}."""
source = "browser/chrome/browser/tabbrowser.properties"
target = "browser/browser/tabbrowser.ftl"
browser_source = "browser/chrome/browser/browser.properties"
browser_target = "browser/browser/browser.ftl"
ctx.add_transforms(
target,
target,
[
FTL.Message(
id=FTL.Identifier("tabbrowser-empty-tab-title"),
value=COPY(source, "tabs.emptyTabTitle"),
),
FTL.Message(
id=FTL.Identifier("tabbrowser-empty-private-tab-title"),
value=COPY(source, "tabs.emptyPrivateTabTitle2"),
),
FTL.Message(
id=FTL.Identifier("tabbrowser-menuitem-close-tab"),
attributes=[
FTL.Attribute(
id=FTL.Identifier("label"), value=COPY(source, "tabs.closeTab")
)
],
),
FTL.Message(
id=FTL.Identifier("tabbrowser-menuitem-close"),
attributes=[
FTL.Attribute(
id=FTL.Identifier("label"), value=COPY(source, "tabs.close")
)
],
),
FTL.Message(
id=FTL.Identifier("tabbrowser-container-tab-title"),
value=REPLACE(
source,
"tabs.containers.tooltip",
{
"%1$S": VARIABLE_REFERENCE("title"),
"%2$S": VARIABLE_REFERENCE("containerName"),
},
),
),
FTL.Message(
id=FTL.Identifier("tabbrowser-tab-tooltip"),
attributes=[
FTL.Attribute(
id=FTL.Identifier("label"),
value=FTL.Pattern([FTL.Placeable(VARIABLE_REFERENCE("title"))]),
)
],
),
FTL.Message(
id=FTL.Identifier("tabbrowser-close-tabs-tooltip"),
attributes=[
FTL.Attribute(
id=FTL.Identifier("label"),
value=PLURALS(
source,
"tabs.closeTabs.tooltip",
VARIABLE_REFERENCE("tabCount"),
foreach=lambda n: REPLACE_IN_TEXT(
n,
{"#1": VARIABLE_REFERENCE("tabCount")},
),
),
)
],
),
FTL.Message(
id=FTL.Identifier("tabbrowser-mute-tab-audio-tooltip"),
attributes=[
FTL.Attribute(
id=FTL.Identifier("label"),
value=PLURALS(
source,
"tabs.muteAudio2.tooltip",
VARIABLE_REFERENCE("tabCount"),
foreach=lambda text: REPLACE_IN_TEXT(
text,
{
"#1": VARIABLE_REFERENCE("tabCount"),
"%S": VARIABLE_REFERENCE("shortcut"),
},
),
),
)
],
),
FTL.Message(
id=FTL.Identifier("tabbrowser-unmute-tab-audio-tooltip"),
attributes=[
FTL.Attribute(
id=FTL.Identifier("label"),
value=PLURALS(
source,
"tabs.unmuteAudio2.tooltip",
VARIABLE_REFERENCE("tabCount"),
foreach=lambda text: REPLACE_IN_TEXT(
text,
{
"#1": VARIABLE_REFERENCE("tabCount"),
"%S": VARIABLE_REFERENCE("shortcut"),
},
),
),
)
],
),
FTL.Message(
id=FTL.Identifier("tabbrowser-mute-tab-audio-background-tooltip"),
attributes=[
FTL.Attribute(
id=FTL.Identifier("label"),
value=PLURALS(
source,
"tabs.muteAudio2.background.tooltip",
VARIABLE_REFERENCE("tabCount"),
foreach=lambda n: REPLACE_IN_TEXT(
n,
{"#1": VARIABLE_REFERENCE("tabCount")},
),
),
)
],
),
FTL.Message(
id=FTL.Identifier("tabbrowser-unmute-tab-audio-background-tooltip"),
attributes=[
FTL.Attribute(
id=FTL.Identifier("label"),
value=PLURALS(
source,
"tabs.unmuteAudio2.background.tooltip",
VARIABLE_REFERENCE("tabCount"),
foreach=lambda n: REPLACE_IN_TEXT(
n,
{"#1": VARIABLE_REFERENCE("tabCount")},
),
),
)
],
),
FTL.Message(
id=FTL.Identifier("tabbrowser-unblock-tab-audio-tooltip"),
attributes=[
FTL.Attribute(
id=FTL.Identifier("label"),
value=PLURALS(
source,
"tabs.unblockAudio2.tooltip",
VARIABLE_REFERENCE("tabCount"),
foreach=lambda n: REPLACE_IN_TEXT(
n,
{"#1": VARIABLE_REFERENCE("tabCount")},
),
),
)
],
),
FTL.Message(
id=FTL.Identifier("tabbrowser-confirm-close-tabs-title"),
value=PLURALS(
source,
"tabs.closeTabsTitle",
VARIABLE_REFERENCE("tabCount"),
foreach=lambda n: REPLACE_IN_TEXT(
n,
{"#1": VARIABLE_REFERENCE("tabCount")},
),
),
),
FTL.Message(
id=FTL.Identifier("tabbrowser-confirm-close-tabs-button"),
value=COPY(source, "tabs.closeButtonMultiple"),
),
FTL.Message(
id=FTL.Identifier("tabbrowser-confirm-close-tabs-checkbox"),
value=COPY(source, "tabs.closeTabsConfirmCheckbox"),
),
FTL.Message(
id=FTL.Identifier("tabbrowser-confirm-close-windows-title"),
value=PLURALS(
source,
"tabs.closeWindowsTitle",
VARIABLE_REFERENCE("windowCount"),
foreach=lambda n: REPLACE_IN_TEXT(
n,
{"#1": VARIABLE_REFERENCE("windowCount")},
),
),
),
FTL.Message(
id=FTL.Identifier("tabbrowser-confirm-close-windows-button"),
value=Transform.pattern_of(
FTL.SelectExpression(
selector=FTL.FunctionReference(
id=FTL.Identifier("PLATFORM"), arguments=FTL.CallArguments()
),
variants=[
FTL.Variant(
key=FTL.Identifier("windows"),
value=COPY(source, "tabs.closeWindowsButtonWin"),
),
FTL.Variant(
key=FTL.Identifier("other"),
value=COPY(source, "tabs.closeWindowsButton"),
default=True,
),
],
)
),
),
FTL.Message(
id=FTL.Identifier("tabbrowser-confirm-close-tabs-with-key-title"),
value=REPLACE(
source,
"tabs.closeTabsWithKeyTitle",
{"%1$S": TERM_REFERENCE("brand-short-name")},
),
),
FTL.Message(
id=FTL.Identifier("tabbrowser-confirm-close-tabs-with-key-button"),
value=REPLACE(
source,
"tabs.closeTabsWithKeyButton",
{"%1$S": TERM_REFERENCE("brand-short-name")},
),
),
FTL.Message(
id=FTL.Identifier("tabbrowser-confirm-close-tabs-with-key-checkbox"),
value=REPLACE(
source,
"tabs.closeTabsWithKeyConfirmCheckbox",
{"%1$S": VARIABLE_REFERENCE("quitKey")},
),
),
FTL.Message(
id=FTL.Identifier("tabbrowser-confirm-open-multiple-tabs-title"),
value=COPY(source, "tabs.openWarningTitle"),
),
FTL.Message(
id=FTL.Identifier("tabbrowser-confirm-open-multiple-tabs-message"),
value=Transform.pattern_of(
FTL.SelectExpression(
selector=VARIABLE_REFERENCE("tabCount"),
variants=[
FTL.Variant(
key=FTL.Identifier("other"),
value=REPLACE(
source,
"tabs.openWarningMultipleBranded",
{
"%1$S": VARIABLE_REFERENCE("tabCount"),
"%2$S": TERM_REFERENCE("brand-short-name"),
". ": FTL.TextElement(". "),
},
),
default=True,
),
],
)
),
),
FTL.Message(
id=FTL.Identifier("tabbrowser-confirm-open-multiple-tabs-button"),
value=COPY(source, "tabs.openButtonMultiple"),
),
FTL.Message(
id=FTL.Identifier("tabbrowser-confirm-open-multiple-tabs-checkbox"),
value=REPLACE(
source,
"tabs.openWarningPromptMeBranded",
{"%1$S": TERM_REFERENCE("brand-short-name")},
),
),
FTL.Message(
id=FTL.Identifier("tabbrowser-confirm-caretbrowsing-title"),
value=COPY(source, "browsewithcaret.checkWindowTitle"),
),
FTL.Message(
id=FTL.Identifier("tabbrowser-confirm-caretbrowsing-message"),
value=COPY(source, "browsewithcaret.checkLabel"),
),
FTL.Message(
id=FTL.Identifier("tabbrowser-confirm-caretbrowsing-checkbox"),
value=COPY(source, "browsewithcaret.checkMsg"),
),
FTL.Message(
id=FTL.Identifier("tabbrowser-customizemode-tab-title"),
value=REPLACE(
browser_source,
"customizeMode.tabTitle",
{"%1$S": TERM_REFERENCE("brand-short-name")},
),
),
FTL.Message(
id=FTL.Identifier("tabbrowser-context-mute-tab"),
attributes=[
FTL.Attribute(
id=FTL.Identifier("label"),
value=COPY(browser_source, "muteTab.label"),
),
FTL.Attribute(
id=FTL.Identifier("accesskey"),
value=COPY(browser_source, "muteTab.accesskey"),
),
],
),
FTL.Message(
id=FTL.Identifier("tabbrowser-context-unmute-tab"),
attributes=[
FTL.Attribute(
id=FTL.Identifier("label"),
value=COPY(browser_source, "unmuteTab.label"),
),
FTL.Attribute(
id=FTL.Identifier("accesskey"),
value=COPY(browser_source, "unmuteTab.accesskey"),
),
],
),
FTL.Message(
id=FTL.Identifier("tabbrowser-context-mute-selected-tabs"),
attributes=[
FTL.Attribute(
id=FTL.Identifier("label"),
value=COPY(browser_source, "muteSelectedTabs2.label"),
),
FTL.Attribute(
id=FTL.Identifier("accesskey"),
value=COPY(browser_source, "muteSelectedTabs2.accesskey"),
),
],
),
FTL.Message(
id=FTL.Identifier("tabbrowser-context-unmute-selected-tabs"),
attributes=[
FTL.Attribute(
id=FTL.Identifier("label"),
value=COPY(browser_source, "unmuteSelectedTabs2.label"),
),
FTL.Attribute(
id=FTL.Identifier("accesskey"),
value=COPY(browser_source, "unmuteSelectedTabs2.accesskey"),
),
],
),
],
)
ctx.add_transforms(
browser_target,
browser_target,
[
FTL.Message(
id=FTL.Identifier("refresh-blocked-refresh-label"),
value=REPLACE(
browser_source,
"refreshBlocked.refreshLabel",
{"%1$S": TERM_REFERENCE("brand-short-name")},
),
),
FTL.Message(
id=FTL.Identifier("refresh-blocked-redirect-label"),
value=REPLACE(
browser_source,
"refreshBlocked.redirectLabel",
{"%1$S": TERM_REFERENCE("brand-short-name")},
),
),
FTL.Message(
id=FTL.Identifier("refresh-blocked-allow"),
attributes=[
FTL.Attribute(
id=FTL.Identifier("label"),
value=COPY(browser_source, "refreshBlocked.goButton"),
),
FTL.Attribute(
id=FTL.Identifier("accesskey"),
value=COPY(browser_source, "refreshBlocked.goButton.accesskey"),
),
],
),
],
)

View File

@ -1,54 +0,0 @@
# coding=utf8
# Any copyright is dedicated to the Public Domain.
# http://creativecommons.org/publicdomain/zero/1.0/
from fluent.migrate import COPY_PATTERN
from fluent.migrate.helpers import transforms_from
def migrate(ctx):
"""Bug 1780585 - Enhanced focused states on PiP controls, part {index}."""
ctx.add_transforms(
"toolkit/toolkit/pictureinpicture/pictureinpicture.ftl",
"toolkit/toolkit/pictureinpicture/pictureinpicture.ftl",
transforms_from(
"""
pictureinpicture-pause-btn =
.aria-label = {COPY_PATTERN(from_path, "pictureinpicture-pause-cmd.aria-label")}
.tooltip = {COPY_PATTERN(from_path, "pictureinpicture-pause-cmd.title")}
pictureinpicture-play-btn =
.aria-label = {COPY_PATTERN(from_path, "pictureinpicture-play-cmd.aria-label")}
.tooltip = {COPY_PATTERN(from_path, "pictureinpicture-play-cmd.title")}
pictureinpicture-mute-btn =
.aria-label = {COPY_PATTERN(from_path, "pictureinpicture-mute-cmd.aria-label")}
.tooltip = {COPY_PATTERN(from_path, "pictureinpicture-mute-cmd.title")}
pictureinpicture-unmute-btn =
.aria-label = {COPY_PATTERN(from_path, "pictureinpicture-unmute-cmd.aria-label")}
.tooltip = {COPY_PATTERN(from_path, "pictureinpicture-unmute-cmd.title")}
pictureinpicture-unpip-btn =
.aria-label = {COPY_PATTERN(from_path, "pictureinpicture-unpip-cmd.aria-label")}
.tooltip = {COPY_PATTERN(from_path, "pictureinpicture-unpip-cmd.title")}
pictureinpicture-close-btn =
.aria-label = {COPY_PATTERN(from_path, "pictureinpicture-close-cmd.aria-label")}
.tooltip = {COPY_PATTERN(from_path, "pictureinpicture-close-cmd.title")}
pictureinpicture-subtitles-btn =
.aria-label = {COPY_PATTERN(from_path, "pictureinpicture-subtitles-cmd.aria-label")}
.tooltip = {COPY_PATTERN(from_path, "pictureinpicture-subtitles-cmd.title")}
pictureinpicture-fullscreen-btn =
.aria-label = {COPY_PATTERN(from_path, "pictureinpicture-fullscreen-cmd.aria-label")}
.tooltip = {COPY_PATTERN(from_path, "pictureinpicture-fullscreen-cmd.title")}
pictureinpicture-exit-fullscreen-btn =
.aria-label = {COPY_PATTERN(from_path, "pictureinpicture-exit-fullscreen-cmd.aria-label")}
.tooltip = {COPY_PATTERN(from_path, "pictureinpicture-exit-fullscreen-cmd.title")}
pictureinpicture-seekbackward-btn =
.aria-label = {COPY_PATTERN(from_path, "pictureinpicture-seekbackward-cmd.aria-label")}
.tooltip = {COPY_PATTERN(from_path, "pictureinpicture-seekbackward-cmd.title")}
pictureinpicture-seekforward-btn =
.aria-label = {COPY_PATTERN(from_path, "pictureinpicture-seekforward-cmd.aria-label")}
.tooltip = {COPY_PATTERN(from_path, "pictureinpicture-seekforward-cmd.title")}
""",
from_path="toolkit/toolkit/pictureinpicture/pictureinpicture.ftl",
),
)

View File

@ -1,22 +0,0 @@
# coding=utf8
# Any copyright is dedicated to the Public Domain.
# http://creativecommons.org/publicdomain/zero/1.0/
from fluent.migrate import COPY_PATTERN
from fluent.migrate.helpers import transforms_from
def migrate(ctx):
"""Bug 1790387 - A11y improvements for the Feature Callout step indicator, part {index}"""
ctx.add_transforms(
"browser/browser/newtab/onboarding.ftl",
"browser/browser/newtab/onboarding.ftl",
transforms_from(
"""
onboarding-welcome-steps-indicator-label =
.aria-label = { COPY_PATTERN(from_path, "onboarding-welcome-steps-indicator2.aria-valuetext") }
""",
from_path="browser/browser/newtab/onboarding.ftl",
),
)

View File

@ -1,187 +0,0 @@
# Any copyright is dedicated to the Public Domain.
# http://creativecommons.org/publicdomain/zero/1.0/
import fluent.syntax.ast as FTL
from fluent.migrate.helpers import VARIABLE_REFERENCE
from fluent.migrate.transforms import COPY, REPLACE, Transform
def migrate(ctx):
"""Bug 1791178 - Convert DownloadUIHelper.jsm to Fluent, part {index}."""
source = "toolkit/chrome/mozapps/downloads/downloads.properties"
target = "toolkit/toolkit/downloads/downloadUI.ftl"
ctx.add_transforms(
target,
target,
[
FTL.Message(
id=FTL.Identifier("download-ui-confirm-title"),
value=COPY(source, "quitCancelDownloadsAlertTitle"),
),
FTL.Message(
id=FTL.Identifier("download-ui-confirm-quit-cancel-downloads"),
value=Transform.pattern_of(
FTL.SelectExpression(
selector=VARIABLE_REFERENCE("downloadsCount"),
variants=[
FTL.Variant(
key=FTL.Identifier("1"),
value=COPY(source, "quitCancelDownloadsAlertMsg"),
),
FTL.Variant(
key=FTL.Identifier("other"),
default=True,
value=REPLACE(
source,
"quitCancelDownloadsAlertMsgMultiple",
{"%1$S": VARIABLE_REFERENCE("downloadsCount")},
),
),
],
)
),
),
FTL.Message(
id=FTL.Identifier("download-ui-confirm-quit-cancel-downloads-mac"),
value=Transform.pattern_of(
FTL.SelectExpression(
selector=VARIABLE_REFERENCE("downloadsCount"),
variants=[
FTL.Variant(
key=FTL.Identifier("1"),
value=COPY(source, "quitCancelDownloadsAlertMsgMac"),
),
FTL.Variant(
key=FTL.Identifier("other"),
default=True,
value=REPLACE(
source,
"quitCancelDownloadsAlertMsgMacMultiple",
{"%1$S": VARIABLE_REFERENCE("downloadsCount")},
),
),
],
)
),
),
FTL.Message(
id=FTL.Identifier("download-ui-confirm-offline-cancel-downloads"),
value=Transform.pattern_of(
FTL.SelectExpression(
selector=VARIABLE_REFERENCE("downloadsCount"),
variants=[
FTL.Variant(
key=FTL.Identifier("1"),
value=COPY(source, "offlineCancelDownloadsAlertMsg"),
),
FTL.Variant(
key=FTL.Identifier("other"),
default=True,
value=REPLACE(
source,
"offlineCancelDownloadsAlertMsgMultiple",
{"%1$S": VARIABLE_REFERENCE("downloadsCount")},
),
),
],
)
),
),
FTL.Message(
id=FTL.Identifier(
"download-ui-confirm-leave-private-browsing-windows-cancel-downloads"
),
value=Transform.pattern_of(
FTL.SelectExpression(
selector=VARIABLE_REFERENCE("downloadsCount"),
variants=[
FTL.Variant(
key=FTL.Identifier("1"),
value=COPY(
source,
"leavePrivateBrowsingWindowsCancelDownloadsAlertMsg2",
),
),
FTL.Variant(
key=FTL.Identifier("other"),
default=True,
value=REPLACE(
source,
"leavePrivateBrowsingWindowsCancelDownloadsAlertMsgMultiple2",
{"%1$S": VARIABLE_REFERENCE("downloadsCount")},
),
),
],
)
),
),
FTL.Message(
id=FTL.Identifier("download-ui-cancel-downloads-ok"),
value=Transform.pattern_of(
FTL.SelectExpression(
selector=VARIABLE_REFERENCE("downloadsCount"),
variants=[
FTL.Variant(
key=FTL.Identifier("1"),
value=COPY(source, "cancelDownloadsOKText"),
),
FTL.Variant(
key=FTL.Identifier("other"),
default=True,
value=REPLACE(
source,
"cancelDownloadsOKTextMultiple",
{"%1$S": VARIABLE_REFERENCE("downloadsCount")},
),
),
],
)
),
),
FTL.Message(
id=FTL.Identifier("download-ui-dont-quit-button"),
value=Transform.pattern_of(
FTL.SelectExpression(
selector=FTL.FunctionReference(
id=FTL.Identifier("PLATFORM"), arguments=FTL.CallArguments()
),
variants=[
FTL.Variant(
key=FTL.Identifier("mac"),
value=COPY(source, "dontQuitButtonMac"),
),
FTL.Variant(
key=FTL.Identifier("other"),
default=True,
value=COPY(source, "dontQuitButtonWin"),
),
],
)
),
),
FTL.Message(
id=FTL.Identifier("download-ui-dont-go-offline-button"),
value=COPY(source, "dontGoOfflineButton"),
),
FTL.Message(
id=FTL.Identifier("download-ui-dont-leave-private-browsing-button"),
value=COPY(source, "dontLeavePrivateBrowsingButton2"),
),
FTL.Message(
id=FTL.Identifier("download-ui-file-executable-security-warning-title"),
value=COPY(source, "fileExecutableSecurityWarningTitle"),
),
FTL.Message(
id=FTL.Identifier("download-ui-file-executable-security-warning"),
value=REPLACE(
source,
"fileExecutableSecurityWarning",
{
"%1$S": VARIABLE_REFERENCE("executable"),
"%2$S": VARIABLE_REFERENCE("executable"),
},
),
),
],
)

View File

@ -1,172 +0,0 @@
# Any copyright is dedicated to the Public Domain.
# http://creativecommons.org/publicdomain/zero/1.0/
import fluent.syntax.ast as FTL
from fluent.migrate.helpers import VARIABLE_REFERENCE
from fluent.migrate.transforms import COPY, PLURALS, REPLACE
def migrate(ctx):
"""Bug 1791178 - Convert DownloadUtils.jsm to Fluent, part {index}."""
source = "toolkit/chrome/mozapps/downloads/downloads.properties"
target = "toolkit/toolkit/downloads/downloadUtils.ftl"
ctx.add_transforms(
target,
target,
[
FTL.Message(
id=FTL.Identifier("download-utils-short-seconds"),
value=PLURALS(source, "shortSeconds", VARIABLE_REFERENCE("timeValue")),
),
FTL.Message(
id=FTL.Identifier("download-utils-short-minutes"),
value=PLURALS(source, "shortMinutes", VARIABLE_REFERENCE("timeValue")),
),
FTL.Message(
id=FTL.Identifier("download-utils-short-hours"),
value=PLURALS(source, "shortHours", VARIABLE_REFERENCE("timeValue")),
),
FTL.Message(
id=FTL.Identifier("download-utils-short-days"),
value=PLURALS(source, "shortDays", VARIABLE_REFERENCE("timeValue")),
),
FTL.Message(
id=FTL.Identifier("download-utils-status"),
value=REPLACE(
source,
"statusFormat3",
{
"%4$S": VARIABLE_REFERENCE("timeLeft"),
"%1$S": VARIABLE_REFERENCE("transfer"),
"%2$S": VARIABLE_REFERENCE("rate"),
"%3$S": VARIABLE_REFERENCE("unit"),
},
),
),
FTL.Message(
id=FTL.Identifier("download-utils-status-infinite-rate"),
value=REPLACE(
source,
"statusFormatInfiniteRate",
{
"%3$S": VARIABLE_REFERENCE("timeLeft"),
"%1$S": VARIABLE_REFERENCE("transfer"),
"%2$S": COPY(source, "infiniteRate"),
},
),
),
FTL.Message(
id=FTL.Identifier("download-utils-status-no-rate"),
value=REPLACE(
source,
"statusFormatNoRate",
{
"%2$S": VARIABLE_REFERENCE("timeLeft"),
"%1$S": VARIABLE_REFERENCE("transfer"),
},
),
),
FTL.Message(
id=FTL.Identifier("download-utils-bytes"), value=COPY(source, "bytes")
),
FTL.Message(
id=FTL.Identifier("download-utils-kilobyte"),
value=COPY(source, "kilobyte"),
),
FTL.Message(
id=FTL.Identifier("download-utils-megabyte"),
value=COPY(source, "megabyte"),
),
FTL.Message(
id=FTL.Identifier("download-utils-gigabyte"),
value=COPY(source, "gigabyte"),
),
FTL.Message(
id=FTL.Identifier("download-utils-transfer-same-units"),
value=REPLACE(
source,
"transferSameUnits2",
{
"%1$S": VARIABLE_REFERENCE("progress"),
"%2$S": VARIABLE_REFERENCE("total"),
"%3$S": VARIABLE_REFERENCE("totalUnits"),
},
),
),
FTL.Message(
id=FTL.Identifier("download-utils-transfer-diff-units"),
value=REPLACE(
source,
"transferDiffUnits2",
{
"%1$S": VARIABLE_REFERENCE("progress"),
"%2$S": VARIABLE_REFERENCE("progressUnits"),
"%3$S": VARIABLE_REFERENCE("total"),
"%4$S": VARIABLE_REFERENCE("totalUnits"),
},
),
),
FTL.Message(
id=FTL.Identifier("download-utils-transfer-no-total"),
value=REPLACE(
source,
"transferNoTotal2",
{
"%1$S": VARIABLE_REFERENCE("progress"),
"%2$S": VARIABLE_REFERENCE("progressUnits"),
},
),
),
FTL.Message(
id=FTL.Identifier("download-utils-time-pair"),
value=REPLACE(
source,
"timePair3",
{
"%1$S": VARIABLE_REFERENCE("time"),
"%2$S": VARIABLE_REFERENCE("unit"),
},
),
),
FTL.Message(
id=FTL.Identifier("download-utils-time-left-single"),
value=REPLACE(
source, "timeLeftSingle3", {"%1$S": VARIABLE_REFERENCE("time")}
),
),
FTL.Message(
id=FTL.Identifier("download-utils-time-left-double"),
value=REPLACE(
source,
"timeLeftDouble3",
{
"%1$S": VARIABLE_REFERENCE("time1"),
"%2$S": VARIABLE_REFERENCE("time2"),
},
),
),
FTL.Message(
id=FTL.Identifier("download-utils-time-few-seconds"),
value=COPY(source, "timeFewSeconds2"),
),
FTL.Message(
id=FTL.Identifier("download-utils-time-unknown"),
value=COPY(source, "timeUnknown2"),
),
FTL.Message(
id=FTL.Identifier("download-utils-done-scheme"),
value=REPLACE(
source, "doneScheme2", {"%1$S": VARIABLE_REFERENCE("scheme")}
),
),
FTL.Message(
id=FTL.Identifier("download-utils-done-file-scheme"),
value=COPY(source, "doneFileScheme"),
),
FTL.Message(
id=FTL.Identifier("download-utils-yesterday"),
value=COPY(source, "yesterday"),
),
],
)

View File

@ -1,39 +0,0 @@
# Any copyright is dedicated to the Public Domain.
# http://creativecommons.org/publicdomain/zero/1.0/
import fluent.syntax.ast as FTL
from fluent.migrate.helpers import VARIABLE_REFERENCE
from fluent.migrate.transforms import COPY, REPLACE
def migrate(ctx):
"""Bug 1791178 - Convert nsContextMenu saveHelper() localization to Fluent, part {index}."""
source = "toolkit/chrome/mozapps/downloads/downloads.properties"
target = "browser/browser/downloads.ftl"
ctx.add_transforms(
target,
target,
[
FTL.Message(
id=FTL.Identifier("downloads-error-alert-title"),
value=COPY(source, "downloadErrorAlertTitle"),
),
FTL.Message(
id=FTL.Identifier("downloads-error-blocked-by"),
value=REPLACE(
source,
"downloadErrorBlockedBy",
{"%1$S": VARIABLE_REFERENCE("extension")},
),
),
FTL.Message(
id=FTL.Identifier("downloads-error-extension"),
value=COPY(source, "downloadErrorExtension"),
),
FTL.Message(
id=FTL.Identifier("downloads-error-generic"),
value=COPY(source, "downloadErrorGeneric"),
),
],
)

View File

@ -1,21 +0,0 @@
# Any copyright is dedicated to the Public Domain.
# http://creativecommons.org/publicdomain/zero/1.0/
from fluent.migrate import COPY_PATTERN
from fluent.migrate.helpers import transforms_from
def migrate(ctx):
"""Bug 1801035 - Stop localizing places window style, part {index}."""
ctx.add_transforms(
"browser/browser/places.ftl",
"browser/browser/places.ftl",
transforms_from(
"""
places-library3 =
.title = {{COPY_PATTERN(from_path, "places-library2.title")}}
""",
from_path="browser/browser/places.ftl",
),
)

View File

@ -1,29 +0,0 @@
# coding=utf8
# Any copyright is dedicated to the Public Domain.
# http://creativecommons.org/publicdomain/zero/1.0/
import fluent.syntax.ast as FTL
from fluent.migrate.helpers import transforms_from
from fluent.migrate.helpers import VARIABLE_REFERENCE
from fluent.migrate import COPY, REPLACE
def migrate(ctx):
"""Bug 1801915 - Migrate confirmation Hints to Fluent"""
ctx.add_transforms(
"browser/browser/confirmationHints.ftl",
"browser/browser/confirmationHints.ftl",
transforms_from(
"""
confirmation-hint-breakage-report-sent = { COPY(from_path, "confirmationHint.breakageReport.label") }
confirmation-hint-login-removed = { COPY(from_path, "confirmationHint.loginRemoved.label") }
confirmation-hint-page-bookmarked = { COPY(from_path, "confirmationHint.pageBookmarked2.label") }
confirmation-hint-password-saved = { COPY(from_path, "confirmationHint.passwordSaved.label") }
confirmation-hint-pin-tab = { COPY(from_path, "confirmationHint.pinTab.label") }
confirmation-hint-pin-tab-description = { COPY(from_path, "confirmationHint.pinTab.description") }
confirmation-hint-send-to-device = { COPY(from_path, "confirmationHint.sendToDevice.label") }
""",
from_path="browser/chrome/browser/browser.properties",
),
)

View File

@ -1,43 +0,0 @@
# Any copyright is dedicated to the Public Domain.
# http://creativecommons.org/publicdomain/zero/1.0/
import fluent.syntax.ast as FTL
from fluent.migrate.transforms import COPY, LegacySource, Transform
class CONTRIB(LegacySource):
"""Custom transform converting a list of contributors from the old RDF based
list of entries into a comma delimited list.
Based on code from python/mozbuild/mozbuild/action/langpack_manifest.py
"""
def __call__(self, ctx):
element: FTL.TextElement = super(CONTRIB, self).__call__(ctx)
str: str = element.value.replace("<em:contributor>", "")
tokens = str.split("</em:contributor>")
tokens = map(lambda t: t.strip(), tokens)
tokens = filter(lambda t: t != "", tokens)
element.value = ", ".join(tokens)
return Transform.pattern_of(element)
def migrate(ctx):
"""Bug 1802128 - Convert langpack defines.inc to Fluent, part {index}."""
browser = "browser/defines.inc"
target = "browser/langpack-metadata.ftl"
ctx.add_transforms(
target,
target,
[
FTL.Message(
id=FTL.Identifier("langpack-creator"),
value=COPY(browser, "MOZ_LANGPACK_CREATOR"),
),
FTL.Message(
id=FTL.Identifier("langpack-contributors"),
value=CONTRIB(browser, "MOZ_LANGPACK_CONTRIBUTORS"),
),
],
)

View File

@ -1,30 +0,0 @@
# Any copyright is dedicated to the Public Domain.
# http://creativecommons.org/publicdomain/zero/1.0/
from fluent.migrate import COPY_PATTERN
from fluent.migrate.helpers import transforms_from
def migrate(ctx):
"""Bug 1803010 - Use .value consistently in downloads.ftl, part {index}."""
for string in [
"downloading-file-opens-in-hours-and-minutes",
"downloading-file-opens-in-minutes",
"downloading-file-opens-in-minutes-and-seconds",
"downloading-file-opens-in-seconds",
"downloading-file-opens-in-some-time",
]:
ctx.add_transforms(
"browser/browser/downloads.ftl",
"browser/browser/downloads.ftl",
transforms_from(
"""
{0}-2 =
.value = {{COPY_PATTERN(from_path, "{0}")}}
""".format(
string
),
from_path="browser/browser/downloads.ftl",
),
)

View File

@ -1,23 +0,0 @@
# Any copyright is dedicated to the Public Domain.
# http://creativecommons.org/publicdomain/zero/1.0/
from fluent.migrate import COPY_PATTERN
import fluent.syntax.ast as FTL
def migrate(ctx):
"""Bug 1805319 - Fix typo in webrtc indicator message id, part {index}."""
path = "browser/browser/webrtcIndicator.ftl"
ctx.add_transforms(
path,
path,
[
FTL.Message(
id=FTL.Identifier("webrtc-allow-share-microphone-unsafe-delegation"),
value=COPY_PATTERN(
path, "webrtc-allow-share-microphone-unsafe-delegations"
),
),
],
)

View File

@ -1,39 +0,0 @@
# Any copyright is dedicated to the Public Domain.
# http://creativecommons.org/publicdomain/zero/1.0/
import fluent.syntax.ast as FTL
import re
from fluent.migrate.transforms import COPY_PATTERN, TransformPattern
class STRIP_SPAN(TransformPattern):
def visit_TextElement(self, node):
node.value = re.sub("</?span[^>]*>", "", node.value)
return node
def migrate(ctx):
"""Bug 1812694 - Add separate aria-valuetext for videocontrols scrubber, part {index}."""
path = "toolkit/toolkit/global/videocontrols.ftl"
ctx.add_transforms(
path,
path,
[
FTL.Message(
id=FTL.Identifier("videocontrols-scrubber-position-and-duration"),
attributes=[
FTL.Attribute(
id=FTL.Identifier("aria-label"),
value=COPY_PATTERN(path, "videocontrols-scrubber.aria-label"),
),
FTL.Attribute(
id=FTL.Identifier("aria-valuetext"),
value=STRIP_SPAN(
path, "videocontrols-position-and-duration-labels"
),
),
],
),
],
)