Skip to content
Snippets Groups Projects
Commit bb6f56ad authored by henry's avatar henry Committed by richard
Browse files

fixup! Tor Browser localization migration scripts.

Bug 42202: Migrate crypto safety strings to Fluent.
parent 58d32687
No related branches found
No related tags found
1 merge request!965Migrate crypto safety strings to Fluent
import fluent.syntax.ast as FTL
from fluent.migrate.helpers import VARIABLE_REFERENCE, transforms_from
from fluent.migrate.transforms import REPLACE
def migrate(ctx):
legacy_path = "cryptoSafetyPrompt.properties"
ctx.add_transforms(
"tor-browser.ftl",
"tor-browser.ftl",
transforms_from(
"""
crypto-safety-prompt-title = { COPY(path, "cryptoSafetyPrompt.cryptoTitle") }
crypto-safety-prompt-reload-button = { COPY(path, "cryptoSafetyPrompt.primaryAction") }
crypto-safety-prompt-dismiss-button = { COPY(path, "cryptoSafetyPrompt.secondaryAction") }
""",
path=legacy_path,
)
+ [
# Replace "%1$S" and "%2$S" with "{ $address }" and "{ $host }"
FTL.Message(
id=FTL.Identifier("crypto-safety-prompt-body"),
value=REPLACE(
legacy_path,
"cryptoSafetyPrompt.cryptoBody",
{
"%1$S": VARIABLE_REFERENCE("address"),
"%2$S": VARIABLE_REFERENCE("host"),
},
),
),
],
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment