Source code
Revision control
Copy as Markdown
Other Tools
# Any copyright is dedicated to the Public Domain.
import fluent.syntax.ast as FTL
from fluent.migrate import COPY, REPLACE
from fluent.migrate.helpers import TERM_REFERENCE
def migrate(ctx):
source = "browser/chrome/browser/siteData.properties"
target = "browser/browser/preferences/siteDataSettings.ftl"
ctx.add_transforms(
target,
target,
[
FTL.Message(
id=FTL.Identifier("site-data-clear-all-prompt-title"),
value=COPY(source, "clearSiteDataPromptTitle"),
),
FTL.Message(
id=FTL.Identifier("site-data-clear-all-prompt-text"),
value=REPLACE(
source,
"clearSiteDataPromptText",
{"%1$S": TERM_REFERENCE("brand-short-name")},
),
),
FTL.Message(
id=FTL.Identifier("site-data-clear-all-prompt-button"),
value=COPY(source, "clearSiteDataNow"),
),
],
)