python/l10n/fluent_migrations/bug_1504457_aboutdevtools.py
author Ryan Hunt <rhunt@eqrion.net>
Tue, 27 Nov 2018 15:32:47 -0600
changeset 453387 462f25bfdc6514d182cd150c8142a03fb6078316
parent 445039 3bc25efb570383f0f50bdc1b90b630abdc4f390f
permissions -rw-r--r--
Bug 1305957 part 6 - Select scroll anchors when flushing notifications in PresShell. r=hiro This commit adds a mechanism for scroll anchor containers to request an anchor node selection at a future time. Currently this is before styling so that anchor adjustment suppression will have current anchor nodes. Differential Revision: https://phabricator.services.mozilla.com/D13269

from __future__ import absolute_import
import fluent.syntax.ast as FTL
from fluent.migrate.helpers import transforms_from
from fluent.migrate.helpers import VARIABLE_REFERENCE
from fluent.migrate.helpers import TERM_REFERENCE
from fluent.migrate.helpers import MESSAGE_REFERENCE
from fluent.migrate import REPLACE
from fluent.migrate import COPY
from fluent.migrate import CONCAT

def migrate(ctx):
    """Bug 1504457 -  Migrate subscribe.js strings of about:devtools to Fluent, part {index}"""

    ctx.add_transforms(
        "devtools/startup/aboutDevTools.ftl",
        "devtools/startup/aboutDevTools.ftl",
        transforms_from(
"""
newsletter-error-unknown = { COPY("devtools/startup/aboutdevtools.properties", "newsletter.error.unknown")}
newsletter-error-timeout = { COPY("devtools/startup/aboutdevtools.properties", "newsletter.error.timeout")}
"""
        )
    )

    ctx.add_transforms(
        "devtools/startup/aboutDevTools.ftl",
        "devtools/startup/aboutDevTools.ftl",
        [
            FTL.Message(
                id=FTL.Identifier("newsletter-error-common"),
                value=REPLACE(
                    "devtools/startup/aboutdevtools.properties",
                    "newsletter.error.common",
                    {
                        "%S": VARIABLE_REFERENCE("errorDescription")
                    }
                )
            )
        ]
    )