Esempio n. 1
0
    def pattern_of(*elements):
        normalized = []

        # Normalize text content: convert text content to TextElements, join
        # adjacent text and prune empty. Text content is either existing
        # TextElements or whitespace-only StringLiterals. This may result in
        # leading and trailing whitespace being put back into TextElements if
        # the new Pattern is built from existing Patterns (CONCAT(COPY...)).
        # The leading and trailing whitespace of the new Pattern will be
        # extracted later into new StringLiterals.
        for element in chain_elements(elements):
            if isinstance(element, FTL.TextElement):
                text_content = element.value
            elif isinstance(element, FTL.Placeable) \
                    and isinstance(element.expression, FTL.StringLiteral) \
                    and re.match(r'^ *$', element.expression.value):
                text_content = element.expression.value
            else:
                # The element does not contain text content which should be
                # normalized. It may be a number, a reference, or
                # a StringLiteral which should be preserved in the Pattern.
                normalized.append(element)
                continue

            previous = normalized[-1] if len(normalized) else None
            if isinstance(previous, FTL.TextElement):
                # Join adjacent TextElements.
                previous.value += text_content
            elif len(text_content) > 0:
                # Normalize non-empty text to a TextElement.
                normalized.append(FTL.TextElement(text_content))
            else:
                # Prune empty text.
                pass

        # Store empty values explicitly as {""}.
        if len(normalized) == 0:
            empty = FTL.Placeable(FTL.StringLiteral(''))
            return FTL.Pattern([empty])

        # Extract explicit leading whitespace into a StringLiteral.
        if isinstance(normalized[0], FTL.TextElement):
            ws, text = extract_whitespace(re_leading_ws, normalized[0])
            normalized[:1] = [ws, text]

        # Extract explicit trailing whitespace into a StringLiteral.
        if isinstance(normalized[-1], FTL.TextElement):
            ws, text = extract_whitespace(re_trailing_ws, normalized[-1])
            normalized[-1:] = [text, ws]

        return FTL.Pattern(
            [element for element in normalized if element is not None])
Esempio n. 2
0
    def __call__(self, ctx):
        # Flatten the list of patterns of which each has a list of elements.
        def concat_elements(acc, cur):
            if isinstance(cur, FTL.Pattern):
                acc.extend(cur.elements)
                return acc
            elif (isinstance(cur, FTL.TextElement) or
                  isinstance(cur, FTL.Placeable)):
                acc.append(cur)
                return acc

            raise RuntimeError(
                'CONCAT accepts FTL Patterns, TextElements and Placeables.'
            )

        # Merge adjecent `FTL.TextElement` nodes.
        def merge_adjecent_text(acc, cur):
            if type(cur) == FTL.TextElement and len(acc):
                last = acc[-1]
                if type(last) == FTL.TextElement:
                    last.value += cur.value
                else:
                    acc.append(cur)
            else:
                acc.append(cur)
            return acc

        elements = reduce(concat_elements, self.patterns, [])
        elements = reduce(merge_adjecent_text, elements, [])
        return FTL.Pattern(elements)
    def __call__(self, ctx):

        # Only replace placeables which are present in the translation.
        replacements = {
            key: evaluate(ctx, repl)
            for key, repl in self.replacements.iteritems()
            if key in self.value
        }

        # Order the original placeables by their position in the translation.
        keys_in_order = sorted(
            replacements.keys(),
            lambda x, y: self.value.find(x) - self.value.find(y)
        )

        # A list of PatternElements built from the legacy translation and the
        # FTL replacements. It may contain empty or adjacent TextElements.
        elements = []
        tail = self.value

        # Convert original placeables and text into FTL Nodes. For each
        # original placeable the translation will be partitioned around it and
        # the text before it will be converted into an `FTL.TextElement` and
        # the placeable will be replaced with its replacement.
        for key in keys_in_order:
            before, key, tail = tail.partition(key)
            elements.append(FTL.TextElement(before))
            elements.append(replacements[key])

        # Dont' forget about the tail after the loop ends.
        elements.append(FTL.TextElement(tail))

        elements = self.flatten_elements(elements)
        elements = self.prune_text_elements(elements)
        return FTL.Pattern(elements)
Esempio n. 4
0
    def __call__(self, ctx):
        value = super(self.__class__, self).__call__(ctx)
        selector = evaluate(ctx, self.selector)
        variants = value.split(';')
        keys = ctx.plural_categories

        # A special case for languages with one plural category. We don't need
        # to insert a SelectExpression at all for them.
        if len(keys) == len(variants) == 1:
            variant, = variants
            return evaluate(ctx, self.foreach(variant))

        last_index = min(len(variants), len(keys)) - 1

        def createVariant(zipped_enum):
            index, (key, variant) = zipped_enum
            # Run the legacy variant through `foreach` which returns an
            # `FTL.Node` describing the transformation required for each
            # variant.  Then evaluate it to a migrated FTL node.
            value = evaluate(ctx, self.foreach(variant))
            return FTL.Variant(
                key=FTL.Symbol(key),
                value=value,
                default=index == last_index
            )

        select = FTL.SelectExpression(
            expression=selector,
            variants=map(createVariant, enumerate(zip(keys, variants)))
        )

        placeable = FTL.Placeable(select)
        return FTL.Pattern([placeable])
Esempio n. 5
0
def cldr_to_ftl(langs, config):

    page_url = ""  # stem of address for individual Region or Language pages
    find_str = ""  # searched tag to extract data
    name_str = ""  # stem of name of ftl variables

    if config == 0:
        page_url = "http://icu-project.org/trac/browser/trunk/icu4c/source/data/lang/"
        find_str = "Languages{"
        name_str = "language-name-{}"
    elif config == 1:
        page_url = "http://icu-project.org/trac/browser/trunk/icu4c/source/data/region/"
        find_str = "Countries{"
        name_str = "region-name-{}"

    directory = "ftl_files/"

    for lang in langs:
        new_directory = re.sub(".txt", "", lang)
        if not os.path.exists(directory + new_directory):
            os.makedirs(directory + new_directory)
        new_file = new_directory + "/resources.ftl"
        wout = open(directory + new_file, "a")
        if lang[-4:] == ".txt":
            source = urllib.request.urlopen(page_url + lang + "?format=txt")
            text = source.read().decode('utf-8', "strict")
            text_lines = text.split("\n")
            interior = 0
            catch = False
            for line in text_lines:
                line = re.sub("\ufeff", "", line)
                if bool(re.search("^//", line)) == False and bool(
                        re.search("[(/**)(**/)]",
                                  line)) == False and line != '':
                    line = re.sub("\s+", " ", line)
                    line = re.sub("^\s", "", line)

                    if "{" in line and "}" not in line:
                        interior += 1
                        if find_str in line:
                            catch = True
                    elif "}" in line and "{" not in line:
                        interior -= 1
                        catch = False
                    elif len(re.findall("{", line)) < 2 and len(
                            re.findall("}", line)) < 2:
                        if catch == True:
                            parts = re.split("[\{\}\"]", line)

                            res = ast.Resource()

                            l10n_id = ast.Identifier(name_str.format(parts[0]))
                            value = ast.Pattern([ast.TextElement(parts[2])])
                            msg = ast.Message(l10n_id, value)
                            res.body.append(msg)

                            s = serialize(res)
                            wout.write(s)
        wout.close()
def migrate(ctx):
    """Bug 1668284 - Unknown content type change settings label is no longer accurate, part {index}."""

    ctx.add_transforms(
        "toolkit/toolkit/global/unknownContentType.ftl",
        "toolkit/toolkit/global/unknownContentType.ftl",
        [
            FTL.Message(
                id=FTL.Identifier("unknowncontenttype-settingschange"),
                attributes=[
                    FTL.Attribute(
                        id=FTL.Identifier("value"),
                        value=FTL.Pattern(
                            elements=[
                                FTL.Placeable(
                                    expression=FTL.SelectExpression(
                                        selector=MESSAGE_REFERENCE("PLATFORM()"),
                                        variants=[
                                            FTL.Variant(
                                                key=FTL.Identifier("windows"),
                                                default=False,
                                                value=REPLACE(
                                                    "toolkit/chrome/mozapps/downloads/settingsChange.dtd",
                                                    "settingsChangeOptions.label",
                                                    {
                                                        "&brandShortName;": TERM_REFERENCE(
                                                            "brand-short-name"
                                                        ),
                                                    },
                                                ),
                                            ),
                                            FTL.Variant(
                                                key=FTL.Identifier("other"),
                                                default=True,
                                                value=REPLACE(
                                                    "toolkit/chrome/mozapps/downloads/settingsChange.dtd",
                                                    "settingsChangePreferences.label",
                                                    {
                                                        "&brandShortName;": TERM_REFERENCE(
                                                            "brand-short-name"
                                                        ),
                                                    },
                                                ),
                                            ),
                                        ],
                                    )
                                )
                            ]
                        ),
                    )
                ],
            )
        ],
    )
Esempio n. 7
0
def build_ftl(messages, dtd, data):
    res = ast.Resource()

    for id_str in messages:
        msg = messages[id_str]
        l10n_id = ast.Identifier(id_str)
        val = None
        attrs = []
        if msg['value']:
            dtd_val = get_value_from_dtd(msg['value'], dtd)
            val = ast.Pattern([ast.TextElement(dtd_val)])
        for attr_name in msg['attrs']:
            dtd_val = get_value_from_dtd(msg['attrs'][attr_name], dtd)
            attr_val = ast.Pattern([ast.TextElement(dtd_val)])
            attrs.append(ast.Attribute(ast.Identifier(attr_name), attr_val))

        m = ast.Message(l10n_id, val, attrs)
        res.body.append(m)

    serializer = FluentSerializer()
    return serializer.serialize(res)
Esempio n. 8
0
    def pattern_of(*elements):
        normalized = []

        # Normalize text content: convert all text to TextElements, join
        # adjacent text and prune empty.
        for current in chain_elements(elements):
            current_text = get_text(current)
            if current_text is None:
                normalized.append(current)
                continue

            previous = normalized[-1] if len(normalized) else None
            if isinstance(previous, FTL.TextElement):
                # Join adjacent TextElements
                previous.value += current_text
            elif len(current_text) > 0:
                # Normalize non-empty text to a TextElement
                normalized.append(FTL.TextElement(current_text))
            else:
                # Prune empty text
                pass

        # Handle empty values
        if len(normalized) == 0:
            empty = FTL.Placeable(FTL.StringLiteral(''))
            return FTL.Pattern([empty])

        # Handle explicit leading whitespace
        if isinstance(normalized[0], FTL.TextElement):
            ws, text = extract_whitespace(re_leading_ws, normalized[0])
            normalized[:1] = [ws, text]

        # Handle explicit trailing whitespace
        if isinstance(normalized[-1], FTL.TextElement):
            ws, text = extract_whitespace(re_trailing_ws, normalized[-1])
            normalized[-1:] = [text, ws]

        return FTL.Pattern(
            [element for element in normalized if element is not None])
Esempio n. 9
0
    def __call__(self, ctx):

        # Only replace placeable which are present in the translation.
        replacements = {
            key: evaluate(ctx, repl)
            for key, repl in self.replacements.iteritems()
            if key in self.value
        }

        # Order the original placeables by their position in the translation.
        keys_in_order = sorted(
            replacements.keys(),
            lambda x, y: self.value.find(x) - self.value.find(y)
        )

        # Used to reduce the `keys_in_order` list.
        def replace(acc, cur):
            """Convert original placeables and text into FTL Nodes.

            For each original placeable the translation will be partitioned
            around it and the text before it will be converted into an
            `FTL.TextElement` and the placeable will be replaced with its
            replacement. The text following the placebale will be fed again to
            the `replace` function.
            """

            parts, rest = acc
            before, key, after = rest.value.partition(cur)

            placeable = FTL.Placeable(replacements[key])

            # Return the elements found and converted so far, and the remaining
            # text which hasn't been scanned for placeables yet.
            return (
                parts + [FTL.TextElement(before), placeable],
                FTL.TextElement(after)
            )

        def is_non_empty(elem):
            """Used for filtering empty `FTL.TextElement` nodes out."""
            return not isinstance(elem, FTL.TextElement) or len(elem.value)

        # Start with an empty list of elements and the original translation.
        init = ([], FTL.TextElement(self.value))
        parts, tail = reduce(replace, keys_in_order, init)

        # Explicitly concat the trailing part to get the full list of elements
        # and filter out the empty ones.
        elements = filter(is_non_empty, parts + [tail])

        return FTL.Pattern(elements)
    def __call__(self, ctx):
        value = super(self.__class__, self).__call__(ctx)
        selector = evaluate(ctx, self.selector)
        variants = value.split(';')
        keys = ctx.plural_categories

        # A special case for languages with one plural category. We don't need
        # to insert a SelectExpression at all for them.
        if len(keys) == len(variants) == 1:
            variant, = variants
            return evaluate(ctx, self.foreach(variant))

        # The default CLDR form should be the last we have in
        # DEFAULT_ORDER, usually `other`, but in some cases `many`.
        # If we don't have a variant for that, we'll append one,
        # using the, in CLDR order, last existing variant in the legacy
        # translation. That may or may not be the last variant.
        default_key = [
            key for key in reversed(self.DEFAULT_ORDER) if key in keys
        ][0]

        keys_and_variants = zip(keys, variants)
        keys_and_variants.sort(key=lambda (k, v): self.DEFAULT_ORDER.index(k))
        last_key, last_variant = keys_and_variants[-1]
        if last_key != default_key:
            keys_and_variants.append((default_key, last_variant))

        def createVariant(key, variant):
            # Run the legacy variant through `foreach` which returns an
            # `FTL.Node` describing the transformation required for each
            # variant.  Then evaluate it to a migrated FTL node.
            value = evaluate(ctx, self.foreach(variant))
            return FTL.Variant(
                key=FTL.VariantName(key),
                value=value,
                default=key == default_key
            )

        select = FTL.SelectExpression(
            expression=selector,
            variants=[
                createVariant(key, variant)
                for key, variant in keys_and_variants
            ]
        )

        placeable = FTL.Placeable(select)
        return FTL.Pattern([placeable])
Esempio n. 11
0
def migrate(ctx):
    """Bug 1445084 - Migrate search results pane of Preferences to Fluent, part {index}."""

    ctx.add_transforms(
        'browser/browser/preferences/preferences.ftl',
        'browser/browser/preferences/preferences.ftl', [
            FTL.Message(
                id=FTL.Identifier('search-input-box'),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('style'),
                        CONCAT(
                            FTL.TextElement('width: '),
                            COPY(
                                'browser/chrome/browser/preferences/preferences.dtd',
                                'searchField.width')),
                    ),
                    FTL.Attribute(
                        FTL.Identifier('placeholder'),
                        FTL.Pattern([
                            FTL.Placeable(
                                FTL.SelectExpression(
                                    expression=FTL.CallExpression(
                                        callee=FTL.Function('PLATFORM')),
                                    variants=[
                                        FTL.Variant(
                                            key=FTL.VariantName('windows'),
                                            default=False,
                                            value=COPY(
                                                'browser/chrome/browser/preferences/preferences.properties',
                                                'searchInput.labelWin')),
                                        FTL.Variant(
                                            key=FTL.VariantName('other'),
                                            default=True,
                                            value=COPY(
                                                'browser/chrome/browser/preferences/preferences.properties',
                                                'searchInput.labelUnix'))
                                    ]))
                        ])),
                ]),
            FTL.Message(
                id=FTL.Identifier('search-results-header'),
                value=COPY(
                    'browser/chrome/browser/preferences/preferences.dtd',
                    'paneSearchResults.title')),
        ])
 def __call__(self, ctx):
     elements = self.flatten_elements(self.elements)
     elements = self.prune_text_elements(elements)
     return FTL.Pattern(elements)
Esempio n. 13
0
def migrate(ctx):
    """Bug 1424682 - Migrate the chrome of Preferences to Fluent, part {index}."""

    ctx.add_transforms(
        'browser/browser/preferences/preferences.ftl',
        'browser/locales/en-US/browser/preferences/preferences.ftl', [
            FTL.Message(
                id=FTL.Identifier('pref-page'),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('title'),
                        FTL.Pattern(elements=[
                            FTL.Placeable(expression=FTL.SelectExpression(
                                expression=FTL.CallExpression(
                                    callee=FTL.Identifier('PLATFORM')),
                                variants=[
                                    FTL.Variant(
                                        key=FTL.VariantName('windows'),
                                        default=False,
                                        value=COPY(
                                            'browser/chrome/browser/preferences/preferences.dtd',
                                            'prefWindow.titleWin')),
                                    FTL.Variant(
                                        key=FTL.VariantName('other'),
                                        default=True,
                                        value=COPY(
                                            'browser/chrome/browser/preferences/preferences.dtd',
                                            'prefWindow.title'))
                                ]))
                        ]))
                ]),
            FTL.Message(
                id=FTL.Identifier('search-input'),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('style'),
                        CONCAT(
                            FTL.TextElement('width: '),
                            COPY(
                                'browser/chrome/browser/preferences/preferences.dtd',
                                'searchField.width')),
                    )
                ]),
            FTL.Message(
                id=FTL.Identifier('pane-general-title'),
                value=COPY(
                    'browser/chrome/browser/preferences/preferences.dtd',
                    'paneGeneral.title')),
            FTL.Message(id=FTL.Identifier('category-general'),
                        attributes=[
                            FTL.Attribute(
                                FTL.Identifier('tooltiptext'),
                                CONCAT(
                                    MESSAGE_REFERENCE('pane-general-title')))
                        ]),
            FTL.Message(
                id=FTL.Identifier('pane-search-title'),
                value=COPY(
                    'browser/chrome/browser/preferences/preferences.dtd',
                    'paneSearch.title')),
            FTL.Message(id=FTL.Identifier('category-search'),
                        attributes=[
                            FTL.Attribute(
                                FTL.Identifier('tooltiptext'),
                                CONCAT(MESSAGE_REFERENCE('pane-search-title')))
                        ]),
            FTL.Message(
                id=FTL.Identifier('pane-privacy-title'),
                value=COPY(
                    'browser/chrome/browser/preferences/preferences.dtd',
                    'panePrivacySecurity.title')),
            FTL.Message(id=FTL.Identifier('category-privacy'),
                        attributes=[
                            FTL.Attribute(
                                FTL.Identifier('tooltiptext'),
                                CONCAT(
                                    MESSAGE_REFERENCE('pane-privacy-title')))
                        ]),
            FTL.Message(
                id=FTL.Identifier('pane-sync-title'),
                value=COPY(
                    'browser/chrome/browser/preferences/preferences.dtd',
                    'paneSync1.title')),
            FTL.Message(id=FTL.Identifier('category-sync'),
                        attributes=[
                            FTL.Attribute(
                                FTL.Identifier('tooltiptext'),
                                CONCAT(MESSAGE_REFERENCE('pane-sync-title')))
                        ]),
            FTL.Message(
                id=FTL.Identifier('help-button-label'),
                value=REPLACE(
                    'browser/chrome/browser/preferences/preferences.dtd',
                    'helpButton2.label', {
                        '&brandShortName;':
                        MESSAGE_REFERENCE('-brand-short-name')
                    })),
            FTL.Message(
                id=FTL.Identifier('focus-search'),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('key'),
                        COPY('toolkit/chrome/passwordmgr/passwordManager.dtd',
                             'focusSearch1.key'))
                ]),
            FTL.Message(id=FTL.Identifier('close-button'),
                        attributes=[
                            FTL.Attribute(
                                FTL.Identifier('aria-label'),
                                COPY('toolkit/chrome/global/preferences.dtd',
                                     'preferencesCloseButton.label'))
                        ]),
            FTL.Message(
                id=FTL.Identifier('feature-enable-requires-restart'),
                value=REPLACE(
                    'browser/chrome/browser/preferences/preferences.properties',
                    'featureEnableRequiresRestart',
                    {'%S': MESSAGE_REFERENCE('-brand-short-name')})),
            FTL.Message(
                id=FTL.Identifier('feature-disable-requires-restart'),
                value=REPLACE(
                    'browser/chrome/browser/preferences/preferences.properties',
                    'featureDisableRequiresRestart',
                    {'%S': MESSAGE_REFERENCE('-brand-short-name')})),
            FTL.Message(
                id=FTL.Identifier('should-restart-title'),
                value=REPLACE(
                    'browser/chrome/browser/preferences/preferences.properties',
                    'shouldRestartTitle',
                    {'%S': MESSAGE_REFERENCE('-brand-short-name')})),
            FTL.Message(
                id=FTL.Identifier('should-restart-ok'),
                value=REPLACE(
                    'browser/chrome/browser/preferences/preferences.properties',
                    'okToRestartButton',
                    {'%S': MESSAGE_REFERENCE('-brand-short-name')})),
            FTL.Message(
                id=FTL.Identifier('restart-later'),
                value=COPY(
                    'browser/chrome/browser/preferences/preferences.properties',
                    'restartLater',
                )),
        ])
Esempio n. 14
0
def migrate(ctx):
    """Bug 1507595 - Migrate about:support messages to use Fluent for localization, part {index}."""

    ctx.add_transforms(
        "toolkit/toolkit/about/aboutSupport.ftl",
        "toolkit/toolkit/about/aboutSupport.ftl",
        transforms_from("""
page-title = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.pageTitle")}
crashes-title = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.crashes.title")}
crashes-id = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.crashes.id")}
crashes-send-date = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.crashes.sendDate")}
crashes-all-reports = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.crashes.allReports")}
crashes-no-config = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.crashes.noConfig")}
extensions-title = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.extensionsTitle")}
extensions-name = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.extensionName")}
extensions-enabled = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.extensionEnabled")}
extensions-version = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.extensionVersion")}
extensions-id = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.extensionId")}
security-software-title = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.securitySoftwareTitle")}
security-software-type = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.securitySoftwareType")}
security-software-name = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.securitySoftwareName")}
security-software-antivirus = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.securitySoftwareAntivirus")}
security-software-antispyware = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.securitySoftwareAntiSpyware")}
security-software-firewall = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.securitySoftwareFirewall")}
features-name = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.featureName")}
features-version = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.featureVersion")}
features-id = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.featureId")}
app-basics-title = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.appBasicsTitle")}
app-basics-name = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.appBasicsName")}
app-basics-version = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.appBasicsVersion")}
app-basics-build-id = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.appBasicsBuildID")}
app-basics-update-channel = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.appBasicsUpdateChannel")}
app-basics-update-history = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.appBasicsUpdateHistory")}
app-basics-show-update-history = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.appBasicsShowUpdateHistory")}
app-basics-enabled-plugins = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.appBasicsEnabledPlugins")}
app-basics-build-config = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.appBasicsBuildConfig")}
app-basics-user-agent = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.appBasicsUserAgent")}
app-basics-os = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.appBasicsOS")}
app-basics-memory-use = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.appBasicsMemoryUse")}
app-basics-performance = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.appBasicsPerformance")}
app-basics-service-workers = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.appBasicsServiceWorkers")}
app-basics-profiles = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.appBasicsProfiles")}
app-basics-multi-process-support = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.appBasicsMultiProcessSupport")}
app-basics-process-count = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.appBasicsProcessCount")}
app-basics-enterprise-policies = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.enterprisePolicies")}
app-basics-location-service-key-google = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.appBasicsLocationServiceKeyGoogle")}
app-basics-safebrowsing-key-google = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.appBasicsSafebrowsingKeyGoogle")}
app-basics-key-mozilla = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.appBasicsKeyMozilla")}
app-basics-safe-mode = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.appBasicsSafeMode")}
modified-key-prefs-title = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.modifiedKeyPrefsTitle")}
modified-prefs-name = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.modifiedPrefsName")}
modified-prefs-value = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.modifiedPrefsValue")}
user-js-title = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.userJSTitle")}
locked-key-prefs-title = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.lockedKeyPrefsTitle")}
locked-prefs-name = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.lockedPrefsName")}
locked-prefs-value = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.lockedPrefsValue")}
graphics-title = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.graphicsTitle")}
graphics-features-title = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.graphicsFeaturesTitle")}
graphics-diagnostics-title = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.graphicsDiagnosticsTitle")}
graphics-failure-log-title = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.graphicsFailureLogTitle")}
graphics-gpu1-title = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.graphicsGPU1Title")}
graphics-gpu2-title = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.graphicsGPU2Title")}
graphics-decision-log-title = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.graphicsDecisionLogTitle")}
graphics-crash-guards-title = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.graphicsCrashGuardsTitle")}
graphics-workarounds-title = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.graphicsWorkaroundsTitle")}
place-database-title = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.placeDatabaseTitle")}
place-database-integrity = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.placeDatabaseIntegrity")}
place-database-verify-integrity = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.placeDatabaseVerifyIntegrity")}
js-title = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.jsTitle")}
js-incremental-gc = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.jsIncrementalGC")}
a11y-title = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.a11yTitle")}
a11y-activated = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.a11yActivated")}
a11y-force-disabled = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.a11yForceDisabled")}
a11y-handler-used = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.a11yHandlerUsed")}
a11y-instantiator = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.a11yInstantiator")}
library-version-title = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.libraryVersionsTitle")}
copy-text-to-clipboard-label = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.copyTextToClipboard.label")}
copy-raw-data-to-clipboard-label = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.copyRawDataToClipboard.label")}
sandbox-title = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.sandboxTitle")}
sandbox-sys-call-log-title = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.sandboxSyscallLogTitle")}
sandbox-sys-call-index = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.sandboxSyscallIndex")}
sandbox-sys-call-age = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.sandboxSyscallAge")}
sandbox-sys-call-pid = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.sandboxSyscallPID")}
sandbox-sys-call-tid = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.sandboxSyscallTID")}
sandbox-sys-call-proc-type = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.sandboxSyscallProcType")}
sandbox-sys-call-number = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.sandboxSyscallNumber")}
sandbox-sys-call-args = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.sandboxSyscallArgs")}
safe-mode-title = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.safeModeTitle")}
restart-in-safe-mode-label = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.restartInSafeMode.label")}
media-title = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.mediaTitle")}
media-output-devices-title = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.mediaOutputDevicesTitle")}
media-input-devices-title = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.mediaInputDevicesTitle")}
media-device-name = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.mediaDeviceName")}
media-device-group = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.mediaDeviceGroup")}
media-device-vendor = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.mediaDeviceVendor")}
media-device-state = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.mediaDeviceState")}
media-device-preferred = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.mediaDevicePreferred")}
media-device-format = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.mediaDeviceFormat")}
media-device-channels = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.mediaDeviceChannels")}
media-device-rate = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.mediaDeviceRate")}
media-device-latency = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.mediaDeviceLatency")}
intl-title = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.intlTitle")}
intl-app-title = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.intlAppTitle")}
intl-locales-requested = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.intlLocalesRequested")}
intl-locales-available = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.intlLocalesAvailable")}
intl-locales-supported = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.intlLocalesSupported")}
intl-locales-default = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.intlLocalesDefault")}
intl-os-title = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.intlOSTitle")}
intl-os-prefs-system-locales = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.intlOSPrefsSystemLocales")}
intl-regional-prefs = { COPY("toolkit/chrome/global/aboutSupport.dtd", "aboutSupport.intlRegionalPrefs")}
raw-data-copied = { COPY("toolkit/chrome/global/aboutSupport.properties", "rawDataCopied")}
text-copied = { COPY("toolkit/chrome/global/aboutSupport.properties", "textCopied")}
clear-type-parameters = { COPY("toolkit/chrome/global/aboutSupport.properties", "clearTypeParameters")}
compositing = { COPY("toolkit/chrome/global/aboutSupport.properties", "compositing")}
hardware-h264 = { COPY("toolkit/chrome/global/aboutSupport.properties", "hardwareH264")}
main-thread-no-omtc = { COPY("toolkit/chrome/global/aboutSupport.properties", "mainThreadNoOMTC")}
yes = { COPY("toolkit/chrome/global/aboutSupport.properties", "yes")}
no = { COPY("toolkit/chrome/global/aboutSupport.properties", "no")}
found = { COPY("toolkit/chrome/global/aboutSupport.properties", "found")}
missing = { COPY("toolkit/chrome/global/aboutSupport.properties", "missing")}
gpu-description = { COPY("toolkit/chrome/global/aboutSupport.properties", "gpuDescription")}
gpu-vendor-id = { COPY("toolkit/chrome/global/aboutSupport.properties", "gpuVendorID")}
gpu-device-id = { COPY("toolkit/chrome/global/aboutSupport.properties", "gpuDeviceID")}
gpu-subsys-id = { COPY("toolkit/chrome/global/aboutSupport.properties", "gpuSubsysID")}
gpu-drivers = { COPY("toolkit/chrome/global/aboutSupport.properties", "gpuDrivers")}
gpu-ram = { COPY("toolkit/chrome/global/aboutSupport.properties", "gpuRAM")}
gpu-driver-version = { COPY("toolkit/chrome/global/aboutSupport.properties", "gpuDriverVersion")}
gpu-driver-date = { COPY("toolkit/chrome/global/aboutSupport.properties", "gpuDriverDate")}
gpu-active = { COPY("toolkit/chrome/global/aboutSupport.properties", "gpuActive")}
webgl1-wsiinfo = { COPY("toolkit/chrome/global/aboutSupport.properties", "webgl1WSIInfo")}
webgl1-renderer = { COPY("toolkit/chrome/global/aboutSupport.properties", "webgl1Renderer")}
webgl1-version = { COPY("toolkit/chrome/global/aboutSupport.properties", "webgl1Version")}
webgl1-driver-extensions = { COPY("toolkit/chrome/global/aboutSupport.properties", "webgl1DriverExtensions")}
webgl1-extensions = { COPY("toolkit/chrome/global/aboutSupport.properties", "webgl1Extensions")}
webgl2-wsiinfo = { COPY("toolkit/chrome/global/aboutSupport.properties", "webgl2WSIInfo")}
webgl2-renderer = { COPY("toolkit/chrome/global/aboutSupport.properties", "webgl2Renderer")}
webgl2-version = { COPY("toolkit/chrome/global/aboutSupport.properties", "webgl2Version")}
webgl2-driver-extensions = { COPY("toolkit/chrome/global/aboutSupport.properties", "webgl2DriverExtensions")}
webgl2-extensions = { COPY("toolkit/chrome/global/aboutSupport.properties", "webgl2Extensions")}
blocklisted-bug = { COPY("toolkit/chrome/global/aboutSupport.properties", "blocklistedBug")}
d3d11layers-crash-guard = { COPY("toolkit/chrome/global/aboutSupport.properties", "d3d11layersCrashGuard")}
d3d11video-crash-guard = { COPY("toolkit/chrome/global/aboutSupport.properties", "d3d11videoCrashGuard")}
d3d9video-crash-buard = { COPY("toolkit/chrome/global/aboutSupport.properties", "d3d9videoCrashGuard")}
glcontext-crash-guard = { COPY("toolkit/chrome/global/aboutSupport.properties", "glcontextCrashGuard")}
reset-on-next-restart = { COPY("toolkit/chrome/global/aboutSupport.properties", "resetOnNextRestart")}
gpu-process-kill-button = { COPY("toolkit/chrome/global/aboutSupport.properties", "gpuProcessKillButton")}
gpu-device-reset-button = { COPY("toolkit/chrome/global/aboutSupport.properties", "gpuDeviceResetButton")}
uses-tiling = { COPY("toolkit/chrome/global/aboutSupport.properties", "usesTiling")}
content-uses-tiling = { COPY("toolkit/chrome/global/aboutSupport.properties", "contentUsesTiling")}
off-main-thread-paint-enabled = { COPY("toolkit/chrome/global/aboutSupport.properties", "offMainThreadPaintEnabled")}
off-main-thread-paint-worker-count = { COPY("toolkit/chrome/global/aboutSupport.properties", "offMainThreadPaintWorkerCount")}
audio-backend = { COPY("toolkit/chrome/global/aboutSupport.properties", "audioBackend")}
max-audio-channels = { COPY("toolkit/chrome/global/aboutSupport.properties", "maxAudioChannels")}
channel-layout = { COPY("toolkit/chrome/global/aboutSupport.properties", "channelLayout")}
sample-rate = { COPY("toolkit/chrome/global/aboutSupport.properties", "sampleRate")}
min-lib-versions = { COPY("toolkit/chrome/global/aboutSupport.properties", "minLibVersions")}
loaded-lib-versions = { COPY("toolkit/chrome/global/aboutSupport.properties", "loadedLibVersions")}
has-seccomp-bpf = { COPY("toolkit/chrome/global/aboutSupport.properties", "hasSeccompBPF")}
has-seccomp-tsync = { COPY("toolkit/chrome/global/aboutSupport.properties", "hasSeccompTSync")}
has-user-namespaces = { COPY("toolkit/chrome/global/aboutSupport.properties", "hasUserNamespaces")}
has-privileged-user-namespaces = { COPY("toolkit/chrome/global/aboutSupport.properties", "hasPrivilegedUserNamespaces")}
can-sandbox-content = { COPY("toolkit/chrome/global/aboutSupport.properties", "canSandboxContent")}
can-sandbox-media = { COPY("toolkit/chrome/global/aboutSupport.properties", "canSandboxMedia")}
content-sandbox-level = { COPY("toolkit/chrome/global/aboutSupport.properties", "contentSandboxLevel")}
effective-content-sandbox-level = { COPY("toolkit/chrome/global/aboutSupport.properties", "effectiveContentSandboxLevel")}
sandbox-proc-type-content = { COPY("toolkit/chrome/global/aboutSupport.properties", "sandboxProcType.content")}
sandbox-proc-type-file = { COPY("toolkit/chrome/global/aboutSupport.properties", "sandboxProcType.file")}
sandbox-proc-type-media-plugin = { COPY("toolkit/chrome/global/aboutSupport.properties", "sandboxProcType.mediaPlugin")}
multi-process-status-0 = { COPY("toolkit/chrome/global/aboutSupport.properties", "multiProcessStatus.0")}
multi-process-status-1 = { COPY("toolkit/chrome/global/aboutSupport.properties", "multiProcessStatus.1")}
multi-process-status-2 = { COPY("toolkit/chrome/global/aboutSupport.properties", "multiProcessStatus.2")}
multi-process-status-4 = { COPY("toolkit/chrome/global/aboutSupport.properties", "multiProcessStatus.4")}
multi-process-status-6 = { COPY("toolkit/chrome/global/aboutSupport.properties", "multiProcessStatus.6")}
multi-process-status-7 = { COPY("toolkit/chrome/global/aboutSupport.properties", "multiProcessStatus.7")}
multi-process-status-8 = { COPY("toolkit/chrome/global/aboutSupport.properties", "multiProcessStatus.8")}
multi-process-status-unknown = { COPY("toolkit/chrome/global/aboutSupport.properties", "multiProcessStatus.unknown")}
async-pan-zoom = { COPY("toolkit/chrome/global/aboutSupport.properties", "asyncPanZoom")}
apz-none = { COPY("toolkit/chrome/global/aboutSupport.properties", "apzNone")}
wheel-enabled = { COPY("toolkit/chrome/global/aboutSupport.properties", "wheelEnabled")}
touch-enabled = { COPY("toolkit/chrome/global/aboutSupport.properties", "touchEnabled")}
drag-enabled = { COPY("toolkit/chrome/global/aboutSupport.properties", "dragEnabled")}
keyboard-enabled = { COPY("toolkit/chrome/global/aboutSupport.properties", "keyboardEnabled")}
autoscroll-enabled = { COPY("toolkit/chrome/global/aboutSupport.properties", "autoscrollEnabled")}
policies-inactive = { COPY("toolkit/chrome/global/aboutSupport.properties", "policies.inactive")}
policies-active = { COPY("toolkit/chrome/global/aboutSupport.properties", "policies.active")}
policies-error = { COPY("toolkit/chrome/global/aboutSupport.properties", "policies.error")}
multi-process-windows = { $remoteWindows }/{ $totalWindows }
blocked-driver = { COPY("toolkit/chrome/global/aboutSupport.properties", "blockedDriver")}
blocked-gfx-card = { COPY("toolkit/chrome/global/aboutSupport.properties", "blockedGfxCard")}
blocked-os-version = { COPY("toolkit/chrome/global/aboutSupport.properties", "blockedOSVersion")}
blocked-mismatched-version = { COPY("toolkit/chrome/global/aboutSupport.properties", "blockedMismatchedVersion")}
"""))

    ctx.add_transforms(
        "toolkit/toolkit/about/aboutSupport.ftl",
        "toolkit/toolkit/about/aboutSupport.ftl", [
            FTL.Message(
                id=FTL.Identifier("page-subtitle"),
                value=REPLACE(
                    "toolkit/chrome/global/aboutSupport.dtd",
                    "aboutSupport.pageSubtitle", {
                        "&brandShortName;":
                        TERM_REFERENCE("-brand-short-name"),
                        "<a id='supportLink'>":
                        FTL.TextElement('<a data-l10n-name="support-link">'),
                    },
                    trim=True)),
            FTL.Message(id=FTL.Identifier("features-title"),
                        value=REPLACE(
                            "toolkit/chrome/global/aboutSupport.dtd",
                            "aboutSupport.featuresTitle",
                            {
                                "&brandShortName;":
                                TERM_REFERENCE("-brand-short-name"),
                            },
                        )),
            FTL.Message(
                id=FTL.Identifier("app-basics-profile-dir"),
                value=FTL.Pattern(elements=[
                    FTL.Placeable(expression=FTL.SelectExpression(
                        selector=FTL.CallExpression(
                            callee=FTL.Function("PLATFORM")),
                        variants=[
                            FTL.Variant(
                                key=FTL.Identifier("linux"),
                                default=False,
                                value=COPY(
                                    "toolkit/chrome/global/aboutSupport.dtd",
                                    "aboutSupport.appBasicsProfileDir")),
                            FTL.Variant(
                                key=FTL.Identifier("other"),
                                default=True,
                                value=COPY(
                                    "toolkit/chrome/global/aboutSupport.dtd",
                                    "aboutSupport.appBasicsProfileDirWinMac")),
                        ]))
                ])),
            FTL.Message(
                id=FTL.Identifier("show-dir-label"),
                value=FTL.Pattern(elements=[
                    FTL.Placeable(expression=FTL.SelectExpression(
                        selector=FTL.CallExpression(
                            callee=FTL.Function("PLATFORM")),
                        variants=[
                            FTL.Variant(
                                key=FTL.Identifier("macos"),
                                default=False,
                                value=COPY(
                                    "toolkit/chrome/global/aboutSupport.dtd",
                                    "aboutSupport.showMac.label")),
                            FTL.Variant(
                                key=FTL.Identifier("windows"),
                                default=False,
                                value=COPY(
                                    "toolkit/chrome/global/aboutSupport.dtd",
                                    "aboutSupport.showWin2.label")),
                            FTL.Variant(
                                key=FTL.Identifier("other"),
                                default=True,
                                value=COPY(
                                    "toolkit/chrome/global/aboutSupport.dtd",
                                    "aboutSupport.showDir.label")),
                        ]))
                ])),
            FTL.Message(
                id=FTL.Identifier("user-js-description"),
                value=REPLACE(
                    "toolkit/chrome/global/aboutSupport.dtd",
                    "aboutSupport.userJSDescription",
                    {
                        "<a id='prefs-user-js-link'>":
                        FTL.TextElement('<a data-l10n-name="user-js-link">'),
                        "&brandShortName;":
                        TERM_REFERENCE("-brand-short-name"),
                    },
                )),
            FTL.Message(id=FTL.Identifier("report-crash-for-days"),
                        value=PLURALS(
                            "toolkit/chrome/global/aboutSupport.properties",
                            "crashesTitle", VARIABLE_REFERENCE("days"),
                            lambda text: REPLACE_IN_TEXT(
                                text, {"#1": VARIABLE_REFERENCE("days")}))),
            FTL.Message(
                id=FTL.Identifier("crashes-time-minutes"),
                value=PLURALS(
                    "toolkit/chrome/global/aboutSupport.properties",
                    "crashesTimeMinutes", VARIABLE_REFERENCE("minutes"),
                    lambda text: REPLACE_IN_TEXT(
                        text, {"#1": VARIABLE_REFERENCE("minutes")}))),
            FTL.Message(id=FTL.Identifier("crashes-time-hours"),
                        value=PLURALS(
                            "toolkit/chrome/global/aboutSupport.properties",
                            "crashesTimeHours", VARIABLE_REFERENCE("hours"),
                            lambda text: REPLACE_IN_TEXT(
                                text, {"#1": VARIABLE_REFERENCE("hours")}))),
            FTL.Message(id=FTL.Identifier("crashes-time-days"),
                        value=PLURALS(
                            "toolkit/chrome/global/aboutSupport.properties",
                            "crashesTimeDays", VARIABLE_REFERENCE("days"),
                            lambda text: REPLACE_IN_TEXT(
                                text, {"#1": VARIABLE_REFERENCE("days")}))),
            FTL.Message(id=FTL.Identifier("pending-reports"),
                        value=PLURALS(
                            "toolkit/chrome/global/aboutSupport.properties",
                            "pendingReports", VARIABLE_REFERENCE("reports"),
                            lambda text: REPLACE_IN_TEXT(
                                text, {"#1": VARIABLE_REFERENCE("reports")}))),
            FTL.Message(id=FTL.Identifier("bug-link"),
                        value=REPLACE(
                            "toolkit/chrome/global/aboutSupport.properties",
                            "bugLink",
                            {
                                "%1$S": VARIABLE_REFERENCE("bugNumber"),
                            },
                        )),
            FTL.Message(id=FTL.Identifier("unknown-failure"),
                        value=REPLACE(
                            "toolkit/chrome/global/aboutSupport.properties",
                            "unknownFailure",
                            {
                                "%1$S": VARIABLE_REFERENCE("failureCode"),
                            },
                        )),
            FTL.Message(id=FTL.Identifier("wheel-warning"),
                        value=REPLACE(
                            "toolkit/chrome/global/aboutSupport.properties",
                            "wheelWarning",
                            {
                                "%S": VARIABLE_REFERENCE("preferenceKey"),
                            },
                        )),
            FTL.Message(id=FTL.Identifier("touch-warning"),
                        value=REPLACE(
                            "toolkit/chrome/global/aboutSupport.properties",
                            "touchWarning",
                            {
                                "%S": VARIABLE_REFERENCE("preferenceKey"),
                            },
                        )),
            FTL.Message(id=FTL.Identifier("try-newer-driver"),
                        value=REPLACE(
                            "toolkit/chrome/global/aboutSupport.properties",
                            "tryNewerDriver",
                            {
                                "%S": VARIABLE_REFERENCE("driverVersion"),
                            },
                        )),
        ])
def migrate(ctx):
    """Bug 1529071 - Migrate printPreview to fluent, part {index}"""

    ctx.maybe_add_localization('toolkit/chrome/global/printPreview.dtd')

    ctx.add_transforms(
        'toolkit/toolkit/printing/printPreview.ftl',
        'toolkit/toolkit/printing/printPreview.ftl',
        transforms_from("""
printpreview-simplify-page-checkbox = 
    .label = { COPY("toolkit/chrome/global/printPreview.dtd", "simplifyPage.label") }
    .accesskey = { COPY("toolkit/chrome/global/printPreview.dtd", "simplifyPage.accesskey") }
    .tooltiptext = { COPY("toolkit/chrome/global/printPreview.dtd", "simplifyPage.disabled.tooltip") }
printpreview-close = 
    .label = { COPY("toolkit/chrome/global/printPreview.dtd", "close.label") }
    .accesskey = { COPY("toolkit/chrome/global/printPreview.dtd", "close.accesskey") }
printpreview-portrait = 
    .label = { COPY("toolkit/chrome/global/printPreview.dtd", "portrait.label") }
    .accesskey = { COPY("toolkit/chrome/global/printPreview.dtd", "portrait.accesskey") }
printpreview-landscape = 
    .label = { COPY("toolkit/chrome/global/printPreview.dtd", "landscape.label") }
    .accesskey = { COPY("toolkit/chrome/global/printPreview.dtd", "landscape.accesskey") }
printpreview-scale = 
    .value = { COPY("toolkit/chrome/global/printPreview.dtd", "scale.label") }
    .accesskey = { COPY("toolkit/chrome/global/printPreview.dtd", "scale.accesskey") }
printpreview-shrink-to-fit = 
    .label = { COPY("toolkit/chrome/global/printPreview.dtd", "ShrinkToFit.label") }
printpreview-custom = 
    .label = { COPY("toolkit/chrome/global/printPreview.dtd", "Custom.label") }
printpreview-print = 
    .label = { COPY("toolkit/chrome/global/printPreview.dtd", "print.label") }
    .accesskey = { COPY("toolkit/chrome/global/printPreview.dtd", "print.accesskey") }
printpreview-of = 
    .value = { COPY("toolkit/chrome/global/printPreview.dtd", "of.label") }
printpreview-custom-prompt = 
    .value = { COPY("toolkit/chrome/global/printPreview.dtd", "customPrompt.title") }
printpreview-page-setup = 
    .label = { COPY("toolkit/chrome/global/printPreview.dtd", "pageSetup.label") }
    .accesskey = { COPY("toolkit/chrome/global/printPreview.dtd", "pageSetup.accesskey") }
printpreview-page = 
    .value = { COPY("toolkit/chrome/global/printPreview.dtd", "page.label") }
    .accesskey = { COPY("toolkit/chrome/global/printPreview.dtd", "page.accesskey") }
""")),
    ctx.add_transforms(
        'toolkit/toolkit/printing/printPreview.ftl',
        'toolkit/toolkit/printing/printPreview.ftl', [
            FTL.Message(
                id=FTL.Identifier(
                    "printpreview-simplify-page-checkbox-enabled"),
                attributes=[
                    FTL.Attribute(
                        id=FTL.Identifier("label"),
                        value=FTL.Pattern(elements=[
                            FTL.Placeable(expression=MESSAGE_REFERENCE(
                                "printpreview-simplify-page-checkbox.label"))
                        ])),
                    FTL.Attribute(
                        id=FTL.Identifier("accesskey"),
                        value=FTL.Pattern(elements=[
                            FTL.Placeable(expression=MESSAGE_REFERENCE(
                                "printpreview-simplify-page-checkbox.accesskey"
                            ))
                        ])),
                    FTL.Attribute(id=FTL.Identifier("tooltiptext"),
                                  value=COPY(
                                      "toolkit/chrome/global/printPreview.dtd",
                                      "simplifyPage.enabled.tooltip")),
                ]),
            FTL.Message(id=FTL.Identifier("printpreview-homearrow"),
                        attributes=[
                            FTL.Attribute(
                                id=FTL.Identifier("label"),
                                value=FTL.Pattern(elements=[
                                    FTL.Placeable(
                                        expression=VARIABLE_REFERENCE("arrow"))
                                ])),
                            FTL.Attribute(
                                id=FTL.Identifier("tooltiptext"),
                                value=COPY(
                                    "toolkit/chrome/global/printPreview.dtd",
                                    "homearrow.tooltip")),
                        ]),
            FTL.Message(id=FTL.Identifier("printpreview-previousarrow"),
                        attributes=[
                            FTL.Attribute(
                                id=FTL.Identifier("label"),
                                value=FTL.Pattern(elements=[
                                    FTL.Placeable(
                                        expression=VARIABLE_REFERENCE("arrow"))
                                ])),
                            FTL.Attribute(
                                id=FTL.Identifier("tooltiptext"),
                                value=COPY(
                                    "toolkit/chrome/global/printPreview.dtd",
                                    "previousarrow.tooltip")),
                        ]),
            FTL.Message(id=FTL.Identifier("printpreview-nextarrow"),
                        attributes=[
                            FTL.Attribute(
                                id=FTL.Identifier("label"),
                                value=FTL.Pattern(elements=[
                                    FTL.Placeable(
                                        expression=VARIABLE_REFERENCE("arrow"))
                                ])),
                            FTL.Attribute(
                                id=FTL.Identifier("tooltiptext"),
                                value=COPY(
                                    "toolkit/chrome/global/printPreview.dtd",
                                    "nextarrow.tooltip")),
                        ]),
            FTL.Message(id=FTL.Identifier("printpreview-endarrow"),
                        attributes=[
                            FTL.Attribute(
                                id=FTL.Identifier("label"),
                                value=FTL.Pattern(elements=[
                                    FTL.Placeable(
                                        expression=VARIABLE_REFERENCE("arrow"))
                                ])),
                            FTL.Attribute(
                                id=FTL.Identifier("tooltiptext"),
                                value=COPY(
                                    "toolkit/chrome/global/printPreview.dtd",
                                    "endarrow.tooltip")),
                        ]),
        ])
def migrate(ctx):
    """ Bug 1486935 - Migrate about:profiles to Fluent, part {index}. """

    ctx.add_transforms(
        "toolkit/toolkit/about/aboutProfiles.ftl",
        "toolkit/toolkit/about/aboutProfiles.ftl",
        transforms_from("""
profiles-title = { COPY("toolkit/chrome/global/aboutProfiles.dtd", "aboutProfiles.title")}
profiles-subtitle = { COPY("toolkit/chrome/global/aboutProfiles.dtd", "aboutProfiles.subtitle")}
profiles-create = { COPY("toolkit/chrome/global/aboutProfiles.dtd", "aboutProfiles.create")}
profiles-restart-title = { COPY("toolkit/chrome/global/aboutProfiles.dtd", "aboutProfiles.restart.title")}
profiles-restart-in-safe-mode = { COPY("toolkit/chrome/global/aboutProfiles.dtd", "aboutProfiles.restart.inSafeMode")}
profiles-restart-normal = { COPY("toolkit/chrome/global/aboutProfiles.dtd", "aboutProfiles.restart.normal")}

profiles-is-default = { COPY("toolkit/chrome/global/aboutProfiles.properties", "isDefault")}
profiles-rootdir = { COPY("toolkit/chrome/global/aboutProfiles.properties", "rootDir")}
profiles-localdir = { COPY("toolkit/chrome/global/aboutProfiles.properties", "localDir")}
profiles-current-profile = { COPY("toolkit/chrome/global/aboutProfiles.properties", "currentProfile")}
profiles-in-use-profile = { COPY("toolkit/chrome/global/aboutProfiles.properties", "inUseProfile")}
profiles-rename = { COPY("toolkit/chrome/global/aboutProfiles.properties", "rename")}
profiles-remove = { COPY("toolkit/chrome/global/aboutProfiles.properties", "remove")}
profiles-set-as-default = { COPY("toolkit/chrome/global/aboutProfiles.properties", "setAsDefault")}
profiles-launch-profile = { COPY("toolkit/chrome/global/aboutProfiles.properties", "launchProfile")}
profiles-yes = { COPY("toolkit/chrome/global/aboutProfiles.properties", "yes")}
profiles-no = { COPY("toolkit/chrome/global/aboutProfiles.properties", "no")}
profiles-rename-profile-title = { COPY("toolkit/chrome/global/aboutProfiles.properties", "renameProfileTitle")}
profiles-invalid-profile-name-title = { COPY("toolkit/chrome/global/aboutProfiles.properties", "invalidProfileNameTitle")}
profiles-delete-profile-title = { COPY("toolkit/chrome/global/aboutProfiles.properties", "deleteProfileTitle")}
profiles-delete-files = { COPY("toolkit/chrome/global/aboutProfiles.properties", "deleteFiles")}
profiles-dont-delete-files = { COPY("toolkit/chrome/global/aboutProfiles.properties", "dontDeleteFiles")}
profiles-delete-profile-failed-title = { COPY("toolkit/chrome/global/aboutProfiles.properties", "deleteProfileFailedTitle")}
profiles-delete-profile-failed-message = { COPY("toolkit/chrome/global/aboutProfiles.properties", "deleteProfileFailedMessage")}
"""))

    ctx.add_transforms(
        "toolkit/toolkit/about/aboutProfiles.ftl",
        "toolkit/toolkit/about/aboutProfiles.ftl", [
            FTL.Message(id=FTL.Identifier("profiles-name"),
                        value=REPLACE(
                            "toolkit/chrome/global/aboutProfiles.properties",
                            "name", {
                                "%S": VARIABLE_REFERENCE("name"),
                            })),
            FTL.Message(id=FTL.Identifier("profiles-rename-profile"),
                        value=REPLACE(
                            "toolkit/chrome/global/aboutProfiles.properties",
                            "renameProfile", {
                                "%S": VARIABLE_REFERENCE("name"),
                            })),
            FTL.Message(id=FTL.Identifier("profiles-invalid-profile-name"),
                        value=REPLACE(
                            "toolkit/chrome/global/aboutProfiles.properties",
                            "invalidProfileName", {
                                "%S": VARIABLE_REFERENCE("name"),
                            })),
            FTL.Message(id=FTL.Identifier("profiles-delete-profile-confirm"),
                        value=REPLACE(
                            "toolkit/chrome/global/aboutProfiles.properties",
                            "deleteProfileConfirm", {
                                "%S": VARIABLE_REFERENCE("dir"),
                            })),
            FTL.Message(
                id=FTL.Identifier("profiles-opendir"),
                value=FTL.Pattern(elements=[
                    FTL.Placeable(expression=FTL.SelectExpression(
                        selector=FTL.CallExpression(
                            callee=FTL.Function("PLATFORM")),
                        variants=[
                            FTL.Variant(
                                key=FTL.Identifier("macos"),
                                default=False,
                                value=COPY(
                                    "toolkit/chrome/global/aboutProfiles.properties",
                                    "macOpenDir")),
                            FTL.Variant(
                                key=FTL.Identifier("windows"),
                                default=False,
                                value=COPY(
                                    "toolkit/chrome/global/aboutProfiles.properties",
                                    "winOpenDir2")),
                            FTL.Variant(
                                key=FTL.Identifier("other"),
                                default=True,
                                value=COPY(
                                    "toolkit/chrome/global/aboutProfiles.properties",
                                    "openDir"))
                        ]))
                ]))
        ])
Esempio n. 17
0
def migrate(ctx):
    """Bug 1608197 - Migrate createProfileWizard to Fluent, part {index}."""

    ctx.add_transforms(
        "toolkit/toolkit/global/createProfileWizard.ftl",
        "toolkit/toolkit/global/createProfileWizard.ftl",
        transforms_from(
            """
create-profile-window =
    .title = { COPY(from_path, "newprofile.title", trim:"True") }
    .style = { COPY(from_path, "window.size", trim:"True") }
profile-creation-explanation-4 = { PLATFORM() ->
    [macos] { COPY(from_path, "profileCreationExplanation_4Mac.text", trim:"True") }
   *[other] { COPY(from_path, "profileCreationExplanation_4.text", trim:"True") }
  }
profile-creation-intro = { COPY(from_path, "profileCreationIntro.text", trim:"True") }
profile-prompt = { COPY(from_path, "profilePrompt.label", trim:"True") }
    .accesskey = { COPY(from_path, "profilePrompt.accesskey", trim:"True") }
profile-default-name =
    .value = { COPY(from_path, "profileDefaultName", trim:"True") }
profile-directory-explanation = { COPY(from_path, "profileDirectoryExplanation.text", trim:"True") }
create-profile-choose-folder =
    .label = { COPY(from_path, "button.choosefolder.label", trim:"True") }
    .accesskey = { COPY(from_path, "button.choosefolder.accesskey", trim:"True") }
create-profile-use-default =
    .label = { COPY(from_path, "button.usedefault.label", trim:"True") }
    .accesskey = { COPY(from_path, "button.usedefault.accesskey", trim:"True") }
""",
            from_path="toolkit/chrome/mozapps/profile/createProfileWizard.dtd")
    )
    ctx.add_transforms(
        "toolkit/toolkit/global/createProfileWizard.ftl",
        "toolkit/toolkit/global/createProfileWizard.ftl", [
            FTL.Message(
                id=FTL.Identifier("create-profile-first-page-header"),
                value=FTL.Pattern(elements=[
                    FTL.Placeable(expression=FTL.SelectExpression(
                        selector=FTL.FunctionReference(
                            id=FTL.Identifier(name="PLATFORM"),
                            arguments=FTL.CallArguments(positional=[],
                                                        named=[])),
                        variants=[
                            FTL.Variant(
                                key=FTL.Identifier('macos'),
                                default=False,
                                value=COPY(
                                    "toolkit/chrome/global/wizard.properties",
                                    "default-first-title-mac",
                                )),
                            FTL.Variant(
                                key=FTL.Identifier('other'),
                                default=True,
                                value=REPLACE(
                                    "toolkit/chrome/global/wizard.properties",
                                    "default-first-title", {
                                        "%1$S":
                                        MESSAGE_REFERENCE(
                                            "create-profile-window.title"),
                                    },
                                    normalize_printf=True))
                        ]))
                ])),
            FTL.Message(
                id=FTL.Identifier("profile-creation-explanation-1"),
                value=REPLACE(
                    "toolkit/chrome/mozapps/profile/createProfileWizard.dtd",
                    "profileCreationExplanation_1.text",
                    {"&brandShortName;": TERM_REFERENCE("brand-short-name")},
                    trim=True)),
            FTL.Message(
                id=FTL.Identifier("profile-creation-explanation-2"),
                value=REPLACE(
                    "toolkit/chrome/mozapps/profile/createProfileWizard.dtd",
                    "profileCreationExplanation_2.text",
                    {"&brandShortName;": TERM_REFERENCE("brand-short-name")},
                    trim=True)),
            FTL.Message(
                id=FTL.Identifier("profile-creation-explanation-3"),
                value=REPLACE(
                    "toolkit/chrome/mozapps/profile/createProfileWizard.dtd",
                    "profileCreationExplanation_3.text",
                    {"&brandShortName;": TERM_REFERENCE("brand-short-name")},
                    trim=True)),
            FTL.Message(
                id=FTL.Identifier("create-profile-last-page-header"),
                value=FTL.Pattern(elements=[
                    FTL.Placeable(expression=FTL.SelectExpression(
                        selector=FTL.FunctionReference(
                            id=FTL.Identifier(name="PLATFORM"),
                            arguments=FTL.CallArguments(positional=[],
                                                        named=[])),
                        variants=[
                            FTL.Variant(
                                key=FTL.Identifier('macos'),
                                default=False,
                                value=COPY(
                                    "toolkit/chrome/global/wizard.properties",
                                    "default-last-title-mac",
                                )),
                            FTL.Variant(
                                key=FTL.Identifier('other'),
                                default=True,
                                value=REPLACE(
                                    "toolkit/chrome/global/wizard.properties",
                                    "default-last-title", {
                                        "%1$S":
                                        MESSAGE_REFERENCE(
                                            "create-profile-window.title"),
                                    },
                                    normalize_printf=True))
                        ]))
                ])),
        ])
Esempio n. 18
0
def migrate(ctx):
    """Bug 1445694 - Migrate Preferences::Sync to Fluent, part {index}."""

    ctx.add_transforms(
        'browser/browser/branding/sync-brand.ftl',
        'browser/browser/branding/sync-brand.ftl',
        [
            FTL.Term(
                id=FTL.Identifier('-fxaccount-brand-name'),
                value=COPY(
                    'browser/chrome/browser/syncBrand.dtd',
                    'syncBrand.fxAccount.label'
                )
            ),
        ]
    )

    ctx.add_transforms(
        'browser/browser/preferences/preferences.ftl',
        'browser/browser/preferences/preferences.ftl',
        [
            FTL.Message(
                id=FTL.Identifier('sync-signedout-caption'),
                value=COPY(
                    'browser/chrome/browser/preferences/sync.dtd',
                    'signedOut.caption',
                ),
            ),
            FTL.Message(
                id=FTL.Identifier('sync-signedout-description'),
                value=COPY(
                    'browser/chrome/browser/preferences/sync.dtd',
                    'signedOut.description',
                ),
            ),
            FTL.Message(
                id=FTL.Identifier('sync-signedout-account-title'),
                value=REPLACE(
                    'browser/chrome/browser/preferences/sync.dtd',
                    'signedOut.accountBox.title',
                    {
                        '&syncBrand.fxAccount.label;': MESSAGE_REFERENCE('-fxaccount-brand-name')
                    },
                ),
            ),
            FTL.Message(
                id=FTL.Identifier('sync-signedout-account-create'),
                value=COPY(
                    'browser/chrome/browser/preferences/sync.dtd',
                    'signedOut.accountBox.create2',
                ),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('accesskey'),
                        COPY(
                            'browser/chrome/browser/preferences/sync.dtd',
                            'signedOut.accountBox.create2.accesskey',
                        ),
                    ),
                ],
            ),
            FTL.Message(
                id=FTL.Identifier('sync-signedout-account-signin'),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('label'),
                        COPY(
                            'browser/chrome/browser/preferences/sync.dtd',
                            'signedOut.accountBox.signin2',
                        ),
                    ),
                    FTL.Attribute(
                        FTL.Identifier('accesskey'),
                        COPY(
                            'browser/chrome/browser/preferences/sync.dtd',
                            'signedOut.accountBox.signin2.accesskey',
                        ),
                    ),
                ],
            ),
            FTL.Message(
                id=FTL.Identifier('sync-profile-picture'),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('tooltiptext'),
                        COPY(
                            'browser/chrome/browser/preferences/sync.dtd',
                            'profilePicture.tooltip',
                        ),
                    ),
                ],
            ),
            FTL.Message(
                id=FTL.Identifier('sync-disconnect'),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('label'),
                        COPY(
                            'browser/chrome/browser/preferences/sync.dtd',
                            'disconnect3.label',
                        ),
                    ),
                    FTL.Attribute(
                        FTL.Identifier('accesskey'),
                        COPY(
                            'browser/chrome/browser/preferences/sync.dtd',
                            'disconnect3.accesskey',
                        ),
                    ),
                ],
            ),
            FTL.Message(
                id=FTL.Identifier('sync-manage-account'),
                value=COPY(
                    'browser/chrome/browser/preferences/sync.dtd',
                    'verifiedManage.label',
                ),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('accesskey'),
                        COPY(
                            'browser/chrome/browser/preferences/sync.dtd',
                            'verifiedManage.accesskey',
                        ),
                    ),
                ],
            ),
            FTL.Message(
                id=FTL.Identifier('sync-signedin-unverified'),
                value=CONCAT_BEFORE_AFTER(
                    COPY(
                        'browser/chrome/browser/preferences/sync.dtd',
                        'signedInUnverified.beforename.label',
                    ),
                    EXTERNAL_ARGUMENT('email'),
                    COPY(
                        'browser/chrome/browser/preferences/sync.dtd',
                        'signedInUnverified.aftername.label',
                    ),
                ),
            ),
            FTL.Message(
                id=FTL.Identifier('sync-signedin-login-failure'),
                value=CONCAT_BEFORE_AFTER(
                    COPY(
                        'browser/chrome/browser/preferences/sync.dtd',
                        'signedInLoginFailure.beforename.label',
                    ),
                    EXTERNAL_ARGUMENT('email'),
                    COPY(
                        'browser/chrome/browser/preferences/sync.dtd',
                        'signedInLoginFailure.aftername.label',
                    ),
                )
            ),
            FTL.Message(
                id=FTL.Identifier('sync-resend-verification'),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('label'),
                        COPY(
                            'browser/chrome/browser/preferences/sync.dtd',
                            'resendVerification.label',
                        ),
                    ),
                    FTL.Attribute(
                        FTL.Identifier('accesskey'),
                        COPY(
                            'browser/chrome/browser/preferences/sync.dtd',
                            'resendVerification.accesskey',
                        ),
                    ),
                ],
            ),
            FTL.Message(
                id=FTL.Identifier('sync-remove-account'),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('label'),
                        COPY(
                            'browser/chrome/browser/preferences/sync.dtd',
                            'removeAccount.label',
                        ),
                    ),
                    FTL.Attribute(
                        FTL.Identifier('accesskey'),
                        COPY(
                            'browser/chrome/browser/preferences/sync.dtd',
                            'removeAccount.accesskey',
                        ),
                    ),
                ],
            ),
            FTL.Message(
                id=FTL.Identifier('sync-sign-in'),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('label'),
                        COPY(
                            'browser/chrome/browser/preferences/sync.dtd',
                            'signIn.label',
                        ),
                    ),
                    FTL.Attribute(
                        FTL.Identifier('accesskey'),
                        COPY(
                            'browser/chrome/browser/preferences/sync.dtd',
                            'signIn.accesskey',
                        ),
                    ),
                ],
            ),
            FTL.Message(
                id=FTL.Identifier('sync-signedin-settings-header'),
                value=COPY(
                    'browser/chrome/browser/preferences/sync.dtd',
                    'signedIn.settings.label',
                ),
            ),
            FTL.Message(
                id=FTL.Identifier('sync-signedin-settings-desc'),
                value=REPLACE(
                    'browser/chrome/browser/preferences/sync.dtd',
                    'signedIn.settings.description',
                    {
                        '&brandShortName;': MESSAGE_REFERENCE('-brand-short-name')
                    },
                ),
            ),
            FTL.Message(
                id=FTL.Identifier('sync-engine-bookmarks'),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('label'),
                        COPY(
                            'browser/chrome/browser/preferences/sync.dtd',
                            'engine.bookmarks.label',
                        ),
                    ),
                    FTL.Attribute(
                        FTL.Identifier('accesskey'),
                        COPY(
                            'browser/chrome/browser/preferences/sync.dtd',
                            'engine.bookmarks.accesskey',
                        ),
                    ),
                ],
            ),
            FTL.Message(
                id=FTL.Identifier('sync-engine-history'),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('label'),
                        COPY(
                            'browser/chrome/browser/preferences/sync.dtd',
                            'engine.history.label',
                        ),
                    ),
                    FTL.Attribute(
                        FTL.Identifier('accesskey'),
                        COPY(
                            'browser/chrome/browser/preferences/sync.dtd',
                            'engine.history.accesskey',
                        ),
                    ),
                ],
            ),
            FTL.Message(
                id=FTL.Identifier('sync-engine-tabs'),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('label'),
                        COPY(
                            'browser/chrome/browser/preferences/sync.dtd',
                            'engine.tabs.label2',
                        ),
                    ),
                    FTL.Attribute(
                        FTL.Identifier('tooltiptext'),
                        COPY(
                            'browser/chrome/browser/preferences/sync.dtd',
                            'engine.tabs.title',
                        ),
                    ),
                    FTL.Attribute(
                        FTL.Identifier('accesskey'),
                        COPY(
                            'browser/chrome/browser/preferences/sync.dtd',
                            'engine.tabs.accesskey',
                        ),
                    ),
                ],
            ),
            FTL.Message(
                id=FTL.Identifier('sync-engine-logins'),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('label'),
                        COPY(
                            'browser/chrome/browser/preferences/sync.dtd',
                            'engine.logins.label',
                        ),
                    ),
                    FTL.Attribute(
                        FTL.Identifier('tooltiptext'),
                        COPY(
                            'browser/chrome/browser/preferences/sync.dtd',
                            'engine.logins.title',
                        ),
                    ),
                    FTL.Attribute(
                        FTL.Identifier('accesskey'),
                        COPY(
                            'browser/chrome/browser/preferences/sync.dtd',
                            'engine.logins.accesskey',
                        ),
                    ),
                ],
            ),
            FTL.Message(
                id=FTL.Identifier('sync-engine-addresses'),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('label'),
                        COPY(
                            'browser/chrome/browser/preferences/sync.dtd',
                            'engine.addresses.label',
                        ),
                    ),
                    FTL.Attribute(
                        FTL.Identifier('tooltiptext'),
                        COPY(
                            'browser/chrome/browser/preferences/sync.dtd',
                            'engine.addresses.title',
                        ),
                    ),
                    FTL.Attribute(
                        FTL.Identifier('accesskey'),
                        COPY(
                            'browser/chrome/browser/preferences/sync.dtd',
                            'engine.addresses.accesskey',
                        ),
                    ),
                ],
            ),
            FTL.Message(
                id=FTL.Identifier('sync-engine-creditcards'),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('label'),
                        COPY(
                            'browser/chrome/browser/preferences/sync.dtd',
                            'engine.creditcards.label',
                        ),
                    ),
                    FTL.Attribute(
                        FTL.Identifier('tooltiptext'),
                        COPY(
                            'browser/chrome/browser/preferences/sync.dtd',
                            'engine.creditcards.title',
                        ),
                    ),
                    FTL.Attribute(
                        FTL.Identifier('accesskey'),
                        COPY(
                            'browser/chrome/browser/preferences/sync.dtd',
                            'engine.creditcards.accesskey',
                        ),
                    ),
                ],
            ),
            FTL.Message(
                id=FTL.Identifier('sync-engine-addons'),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('label'),
                        COPY(
                            'browser/chrome/browser/preferences/sync.dtd',
                            'engine.addons.label',
                        ),
                    ),
                    FTL.Attribute(
                        FTL.Identifier('tooltiptext'),
                        COPY(
                            'browser/chrome/browser/preferences/sync.dtd',
                            'engine.addons.title',
                        ),
                    ),
                    FTL.Attribute(
                        FTL.Identifier('accesskey'),
                        COPY(
                            'browser/chrome/browser/preferences/sync.dtd',
                            'engine.addons.accesskey',
                        ),
                    ),
                ],
            ),
            FTL.Message(
                id=FTL.Identifier('sync-engine-prefs'),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('label'),
                        FTL.Pattern([
                            FTL.Placeable(FTL.SelectExpression(
                                expression=FTL.CallExpression(
                                    callee=FTL.Identifier('PLATFORM')
                                ),
                                variants=[
                                    FTL.Variant(
                                        key=FTL.VariantName('windows'),
                                        default=False,
                                        value=COPY(
                                            'browser/chrome/browser/preferences/sync.dtd',
                                            'engine.prefsWin.label'
                                        )
                                    ),
                                    FTL.Variant(
                                        key=FTL.VariantName('other'),
                                        default=True,
                                        value=COPY(
                                            'browser/chrome/browser/preferences/sync.dtd',
                                            'engine.prefs.label'
                                        )
                                    )
                                ]
                            )),
                        ]),
                    ),
                    FTL.Attribute(
                        FTL.Identifier('tooltiptext'),
                        COPY(
                            'browser/chrome/browser/preferences/sync.dtd',
                            'engine.prefs.title'
                        ),
                    ),
                    FTL.Attribute(
                        FTL.Identifier('accesskey'),
                        COPY(
                            'browser/chrome/browser/preferences/sync.dtd',
                            'engine.prefs.accesskey'
                        ),
                    ),
                ],
            ),
            FTL.Message(
                id=FTL.Identifier('sync-device-name-header'),
                value=COPY(
                    'browser/chrome/browser/preferences/sync.dtd',
                    'fxaSyncDeviceName.label',
                ),
            ),
            FTL.Message(
                id=FTL.Identifier('sync-device-name-change'),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('label'),
                        COPY(
                            'browser/chrome/browser/preferences/sync.dtd',
                            'changeSyncDeviceName2.label',
                        ),
                    ),
                    FTL.Attribute(
                        FTL.Identifier('accesskey'),
                        COPY(
                            'browser/chrome/browser/preferences/sync.dtd',
                            'changeSyncDeviceName2.accesskey',
                        ),
                    ),
                ],
            ),
            FTL.Message(
                id=FTL.Identifier('sync-device-name-cancel'),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('label'),
                        COPY(
                            'browser/chrome/browser/preferences/sync.dtd',
                            'cancelChangeSyncDeviceName.label',
                        ),
                    ),
                    FTL.Attribute(
                        FTL.Identifier('accesskey'),
                        COPY(
                            'browser/chrome/browser/preferences/sync.dtd',
                            'cancelChangeSyncDeviceName.accesskey',
                        ),
                    ),
                ],
            ),
            FTL.Message(
                id=FTL.Identifier('sync-device-name-save'),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('label'),
                        COPY(
                            'browser/chrome/browser/preferences/sync.dtd',
                            'saveChangeSyncDeviceName.label',
                        ),
                    ),
                    FTL.Attribute(
                        FTL.Identifier('accesskey'),
                        COPY(
                            'browser/chrome/browser/preferences/sync.dtd',
                            'saveChangeSyncDeviceName.accesskey',
                        ),
                    ),
                ],
            ),
            FTL.Message(
                id=FTL.Identifier('sync-mobilepromo-single'),
                value=COPY(
                    'browser/chrome/browser/preferences/sync.dtd',
                    'mobilepromo.singledevice',
                ),
            ),
            FTL.Message(
                id=FTL.Identifier('sync-mobilepromo-multi'),
                value=COPY(
                    'browser/chrome/browser/preferences/sync.dtd',
                    'mobilepromo.multidevice',
                ),
            ),
            FTL.Message(
                id=FTL.Identifier('sync-tos-link'),
                value=COPY(
                    'browser/chrome/browser/preferences/sync.dtd',
                    'prefs.tosLink.label',
                ),
            ),
            FTL.Message(
                id=FTL.Identifier('sync-fxa-privacy-notice'),
                value=COPY(
                    'browser/chrome/browser/preferences/sync.dtd',
                    'fxaPrivacyNotice.link.label',
                ),
            ),
        ]
    )
Esempio n. 19
0
def migrate(ctx):
    """Bug 1498448 - Migrate Certificate Manager Dialog to use fluent for localization, part {index}."""

    ctx.add_transforms(
        "security/manager/security/certificates/certManager.ftl",
        "security/manager/security/certificates/certManager.ftl",
        transforms_from(
"""
certmgr-title =
    .title = { COPY("security/manager/chrome/pippki/certManager.dtd", "certmgr.title") }

certmgr-tab-mine =
    .label = { COPY("security/manager/chrome/pippki/certManager.dtd", "certmgr.tab.mine") }

certmgr-tab-people =
    .label = { COPY("security/manager/chrome/pippki/certManager.dtd", "certmgr.tab.others2") }

certmgr-tab-servers =
    .label = { COPY("security/manager/chrome/pippki/certManager.dtd", "certmgr.tab.websites3") }

certmgr-tab-ca =
    .label = { COPY("security/manager/chrome/pippki/certManager.dtd", "certmgr.tab.ca") }

certmgr-mine = { COPY("security/manager/chrome/pippki/certManager.dtd", "certmgr.mine2") }
certmgr-people = { COPY("security/manager/chrome/pippki/certManager.dtd", "certmgr.others2") }
certmgr-servers = { COPY("security/manager/chrome/pippki/certManager.dtd", "certmgr.websites3") }
certmgr-ca = { COPY("security/manager/chrome/pippki/certManager.dtd", "certmgr.cas2") }

certmgr-detail-general-tab-title =
    .label = { COPY("security/manager/chrome/pippki/certManager.dtd", "certmgr.detail.general_tab.title") }
    .accesskey = { COPY("security/manager/chrome/pippki/certManager.dtd", "certmgr.detail.general_tab.accesskey") }

certmgr-detail-pretty-print-tab-title =
    .label = { COPY("security/manager/chrome/pippki/certManager.dtd", "certmgr.detail.prettyprint_tab.title") }
    .accesskey = { COPY("security/manager/chrome/pippki/certManager.dtd", "certmgr.detail.prettyprint_tab.accesskey") }

certmgr-pending-label =
    .value = { COPY("security/manager/chrome/pippki/certManager.dtd", "certmgr.pending.label") }

certmgr-subject-info-label =
    .value = { COPY("security/manager/chrome/pippki/certManager.dtd", "certmgr.subjectinfo.label") }

certmgr-issuer-info-label =
    .value = { COPY("security/manager/chrome/pippki/certManager.dtd", "certmgr.issuerinfo.label") }

certmgr-period-of-validity-label =
    .value = { COPY("security/manager/chrome/pippki/certManager.dtd", "certmgr.periodofvalidity.label") }

certmgr-fingerprints-label =
    .value = { COPY("security/manager/chrome/pippki/certManager.dtd", "certmgr.fingerprints.label") }

certmgr-cert-detail =
    .title = { COPY("security/manager/chrome/pippki/certManager.dtd", "certmgr.certdetail.title") }
    .buttonlabelaccept = { COPY("security/manager/chrome/pippki/certManager.dtd", "certmgr.close.label") }
    .buttonaccesskeyaccept = { COPY("security/manager/chrome/pippki/certManager.dtd", "certmgr.close.accesskey") }

certmgr-cert-detail-cn =
    .value = { COPY("security/manager/chrome/pippki/certManager.dtd", "certmgr.certdetail.cn") }

certmgr-cert-detail-o =
    .value = { COPY("security/manager/chrome/pippki/certManager.dtd", "certmgr.certdetail.o") }

certmgr-cert-detail-ou =
    .value = { COPY("security/manager/chrome/pippki/certManager.dtd", "certmgr.certdetail.ou") }

certmgr-cert-detail-serialnumber =
    .value = { COPY("security/manager/chrome/pippki/certManager.dtd", "certmgr.certdetail.serialnumber") }

certmgr-cert-detail-sha256-fingerprint =
    .value = { COPY("security/manager/chrome/pippki/certManager.dtd", "certmgr.certdetail.sha256fingerprint") }

certmgr-cert-detail-sha1-fingerprint =
    .value = { COPY("security/manager/chrome/pippki/certManager.dtd", "certmgr.certdetail.sha1fingerprint") }

certmgr-edit-cert-edit-trust = { COPY("security/manager/chrome/pippki/certManager.dtd", "certmgr.editcert.edittrust") }

certmgr-edit-cert-trust-ssl =
    .label = { COPY("security/manager/chrome/pippki/certManager.dtd", "certmgr.editcert.trustssl") }

certmgr-edit-cert-trust-email =
    .label = { COPY("security/manager/chrome/pippki/certManager.dtd", "certmgr.editcert.trustemail") }

certmgr-cert-name =
    .label = { COPY("security/manager/chrome/pippki/certManager.dtd", "certmgr.certname") }

certmgr-cert-server =
    .label = { COPY("security/manager/chrome/pippki/certManager.dtd", "certmgr.certserver") }

certmgr-override-lifetime
    .label = { COPY("security/manager/chrome/pippki/certManager.dtd", "certmgr.override_lifetime") }

certmgr-token-name =
    .label = { COPY("security/manager/chrome/pippki/certManager.dtd", "certmgr.tokenname") }

certmgr-begins-label =
    .label = { COPY("security/manager/chrome/pippki/certManager.dtd", "certmgr.begins") }

certmgr-expires-label =
    .label = { COPY("security/manager/chrome/pippki/certManager.dtd", "certmgr.expires") }

certmgr-email =
    .label = { COPY("security/manager/chrome/pippki/certManager.dtd", "certmgr.email") }

certmgr-serial =
    .label = { COPY("security/manager/chrome/pippki/certManager.dtd", "certmgr.serial") }

certmgr-view =
    .label = { COPY("security/manager/chrome/pippki/certManager.dtd", "certmgr.view2.label") }
    .accesskey = { COPY("security/manager/chrome/pippki/certManager.dtd", "certmgr.view2.accesskey") }

certmgr-edit =
    .label = { COPY("security/manager/chrome/pippki/certManager.dtd", "certmgr.edit3.label") }
    .accesskey = { COPY("security/manager/chrome/pippki/certManager.dtd", "certmgr.edit3.accesskey") }

certmgr-export =
    .label = { COPY("security/manager/chrome/pippki/certManager.dtd", "certmgr.export.label") }
    .accesskey = { COPY("security/manager/chrome/pippki/certManager.dtd", "certmgr.export.accesskey") }

certmgr-delete =
    .label = { COPY("security/manager/chrome/pippki/certManager.dtd", "certmgr.delete2.label") }
    .accesskey = { COPY("security/manager/chrome/pippki/certManager.dtd", "certmgr.delete2.accesskey") }

certmgr-delete-builtin =
    .label = { COPY("security/manager/chrome/pippki/certManager.dtd", "certmgr.delete_builtin.label") }
    .accesskey = { COPY("security/manager/chrome/pippki/certManager.dtd", "certmgr.delete_builtin.accesskey") }

certmgr-backup =
    .label = { COPY("security/manager/chrome/pippki/certManager.dtd", "certmgr.backup2.label") }
    .accesskey = { COPY("security/manager/chrome/pippki/certManager.dtd", "certmgr.backup2.accesskey") }

certmgr-backup-all =
    .label = { COPY("security/manager/chrome/pippki/certManager.dtd", "certmgr.backupall2.label") }
    .accesskey = { COPY("security/manager/chrome/pippki/certManager.dtd", "certmgr.backupall2.accesskey") }

certmgr-restore =
    .label = { COPY("security/manager/chrome/pippki/certManager.dtd", "certmgr.restore2.label") }
    .accesskey = { COPY("security/manager/chrome/pippki/certManager.dtd", "certmgr.restore2.accesskey") }

certmgr-details =
    .value = { COPY("security/manager/chrome/pippki/certManager.dtd", "certmgr.details.label") }
    .accesskey = { COPY("security/manager/chrome/pippki/certManager.dtd", "certmgr.details.accesskey") }

certmgr-fields=
    .value = { COPY("security/manager/chrome/pippki/certManager.dtd", "certmgr.fields.label") }
    .accesskey = { COPY("security/manager/chrome/pippki/certManager.dtd", "certmgr.fields.accesskey") }

certmgr-hierarchy =
    .value = { COPY("security/manager/chrome/pippki/certManager.dtd", "certmgr.hierarchy.label") }
    .accesskey = { COPY("security/manager/chrome/pippki/certManager.dtd", "certmgr.hierarchy.accesskey2") }

certmgr-add-exception =
    .label = { COPY("security/manager/chrome/pippki/certManager.dtd", "certmgr.addException.label") }
    .accesskey = { COPY("security/manager/chrome/pippki/certManager.dtd", "certmgr.addException.accesskey") }

exception-mgr =
    .title = { COPY("security/manager/chrome/pippki/certManager.dtd", "exceptionMgr.title") }

exception-mgr-extra-button =
    .label = { COPY("security/manager/chrome/pippki/certManager.dtd", "exceptionMgr.exceptionButton.label") }
    .accesskey = { COPY("security/manager/chrome/pippki/certManager.dtd", "exceptionMgr.exceptionButton.accesskey") }

exception-mgr-supplemental-warning = { COPY("security/manager/chrome/pippki/certManager.dtd", "exceptionMgr.supplementalWarning") }

exception-mgr-cert-location-url =
    .value = { COPY("security/manager/chrome/pippki/certManager.dtd", "exceptionMgr.certlocation.url") }

exception-mgr-cert-location-download =
    .label = { COPY("security/manager/chrome/pippki/certManager.dtd", "exceptionMgr.certlocation.download") }
    .accesskey = { COPY("security/manager/chrome/pippki/certManager.dtd", "exceptionMgr.certlocation.accesskey") }

exception-mgr-cert-status-view-cert =
    .label = { COPY("security/manager/chrome/pippki/certManager.dtd", "exceptionMgr.certstatus.viewCert") }
    .accesskey = { COPY("security/manager/chrome/pippki/certManager.dtd", "exceptionMgr.certstatus.accesskey") }

exception-mgr-permanent =
    .label = { COPY("security/manager/chrome/pippki/certManager.dtd", "exceptionMgr.permanent.label") }
    .accesskey = { COPY("security/manager/chrome/pippki/certManager.dtd", "exceptionMgr.permanent.accesskey") }

pk11-bad-password = { COPY("security/manager/chrome/pipnss/pipnss.properties", "PK11BadPassword") }
pkcs12-decode-err = { COPY("security/manager/chrome/pipnss/pipnss.properties", "PKCS12DecodeErr") }
pkcs12-unknown-err-restore = { COPY("security/manager/chrome/pipnss/pipnss.properties", "PKCS12UnknownErrRestore") }
pkcs12-unknown-err-backup = { COPY("security/manager/chrome/pipnss/pipnss.properties", "PKCS12UnknownErrBackup") }
pkcs12-unknown-err = { COPY("security/manager/chrome/pipnss/pipnss.properties", "PKCS12UnknownErr") }
pkcs12-info-no-smartcard-backup = { COPY("security/manager/chrome/pipnss/pipnss.properties", "PKCS12InfoNoSmartcardBackup") }
pkcs12-dup-data = { COPY("security/manager/chrome/pipnss/pipnss.properties", "PKCS12DupData") }

choose-p12-backup-file-dialog = { COPY("security/manager/chrome/pippki/pippki.properties", "chooseP12BackupFileDialog") }
file-browse-pkcs12-spec = { COPY("security/manager/chrome/pippki/pippki.properties", "file_browse_PKCS12_spec") }
choose-p12-restore-file-dialog = { COPY("security/manager/chrome/pippki/pippki.properties", "chooseP12RestoreFileDialog2") }
file-browse-certificate-spec = { COPY("security/manager/chrome/pippki/pippki.properties", "file_browse_Certificate_spec") }
import-ca-certs-prompt = { COPY("security/manager/chrome/pippki/pippki.properties", "importCACertsPrompt") }
import-email-cert-prompt = { COPY("security/manager/chrome/pippki/pippki.properties", "importEmailCertPrompt") }

delete-user-cert-title =
    .title = { COPY("security/manager/chrome/pippki/pippki.properties", "deleteUserCertTitle") }

delete-ssl-cert-title =
    .title = { COPY("security/manager/chrome/pippki/pippki.properties", "deleteSslCertTitle3") }

delete-ca-cert-title =
    .title = { COPY("security/manager/chrome/pippki/pippki.properties", "deleteCaCertTitle2") }

delete-email-cert-title =
    .title = { COPY("security/manager/chrome/pippki/pippki.properties", "deleteEmailCertTitle") }

delete-user-cert-confirm = { COPY("security/manager/chrome/pippki/pippki.properties", "deleteUserCertConfirm") }
delete-user-cert-impact = { COPY("security/manager/chrome/pippki/pippki.properties", "deleteUserCertImpact") }
delete-ssl-cert-confirm = { COPY("security/manager/chrome/pippki/pippki.properties", "deleteSslCertConfirm3") }
delete-ssl-cert-impact = { COPY("security/manager/chrome/pippki/pippki.properties", "deleteSslCertImpact3") }
delete-ca-cert-confirm = { COPY("security/manager/chrome/pippki/pippki.properties", "deleteCaCertConfirm2") }
delete-ca-cert-impact = { COPY("security/manager/chrome/pippki/pippki.properties", "deleteCaCertImpactX2") }
delete-email-cert-confirm = { COPY("security/manager/chrome/pippki/pippki.properties", "deleteEmailCertConfirm") }
delete-email-cert-impact = { COPY("security/manager/chrome/pippki/pippki.properties", "deleteEmailCertImpactDesc") }

cert-verified = { COPY("security/manager/chrome/pippki/pippki.properties", "certVerified") }

not-present =
    .value = { COPY("security/manager/chrome/pippki/pippki.properties", "notPresent") }

verify-ssl-client =
    .value = { COPY("security/manager/chrome/pipnss/pipnss.properties", "VerifySSLClient") }

verify-ssl-server =
    .value = { COPY("security/manager/chrome/pipnss/pipnss.properties", "VerifySSLServer") }

verify-ssl-ca =
    .value = { COPY("security/manager/chrome/pipnss/pipnss.properties", "VerifySSLCA") }

verify-email-signer =
    .value = { COPY("security/manager/chrome/pipnss/pipnss.properties", "VerifyEmailSigner") }

verify-email-recip =
    .value = { COPY("security/manager/chrome/pipnss/pipnss.properties", "VerifyEmailRecip") }

cert-not-verified-cert-revoked = { COPY("security/manager/chrome/pippki/pippki.properties", "certNotVerified_CertRevoked") }
cert-not-verified-cert-expired = { COPY("security/manager/chrome/pippki/pippki.properties", "certNotVerified_CertExpired") }
cert-not-verified-cert-not-trusted = { COPY("security/manager/chrome/pippki/pippki.properties", "certNotVerified_CertNotTrusted") }
cert-not-verified-issuer-not-trusted = { COPY("security/manager/chrome/pippki/pippki.properties", "certNotVerified_IssuerNotTrusted") }
cert-not-verified-issuer-unknown = { COPY("security/manager/chrome/pippki/pippki.properties", "certNotVerified_IssuerUnknown") }
cert-not-verified-ca-invalid = { COPY("security/manager/chrome/pippki/pippki.properties", "certNotVerified_CAInvalid") }
cert-not-verified_algorithm-disabled = { COPY("security/manager/chrome/pippki/pippki.properties", "certNotVerified_AlgorithmDisabled") }
cert-not-verified-unknown = { COPY("security/manager/chrome/pippki/pippki.properties", "certNotVerified_Unknown") }

add-exception-invalid-header = { COPY("security/manager/chrome/pippki/pippki.properties", "addExceptionInvalidHeader") }
add-exception-domain-mismatch-short = { COPY("security/manager/chrome/pippki/pippki.properties", "addExceptionDomainMismatchShort") }
add-exception-domain-mismatch-long = { COPY("security/manager/chrome/pippki/pippki.properties", "addExceptionDomainMismatchLong2") }
add-exception-expired-short = { COPY("security/manager/chrome/pippki/pippki.properties", "addExceptionExpiredShort") }
add-exception-expired-long = { COPY("security/manager/chrome/pippki/pippki.properties", "addExceptionExpiredLong2") }
add-exception-unverified-or-bad-signature-short = { COPY("security/manager/chrome/pippki/pippki.properties", "addExceptionUnverifiedOrBadSignatureShort") }
add-exception-unverified-or-bad-signature-long = { COPY("security/manager/chrome/pippki/pippki.properties", "addExceptionUnverifiedOrBadSignatureLong2") }
add-exception-valid-short = { COPY("security/manager/chrome/pippki/pippki.properties", "addExceptionValidShort") }
add-exception-valid-long = { COPY("security/manager/chrome/pippki/pippki.properties", "addExceptionValidLong") }
add-exception-checking-short = { COPY("security/manager/chrome/pippki/pippki.properties", "addExceptionCheckingShort") }
add-exception-checking-long = { COPY("security/manager/chrome/pippki/pippki.properties", "addExceptionCheckingLong2") }
add-exception-no-cert-short = { COPY("security/manager/chrome/pippki/pippki.properties", "addExceptionNoCertShort") }
add-exception-no-cert-long = { COPY("security/manager/chrome/pippki/pippki.properties", "addExceptionNoCertLong2") }
""")
)

    ctx.add_transforms(
    "security/manager/security/certificates/certManager.ftl",
    "security/manager/security/certificates/certManager.ftl",
    [
        FTL.Message(
            id=FTL.Identifier("edit-trust-ca"),
            value=REPLACE(
                "security/manager/chrome/pippki/pippki.properties",
                "editTrustCA",
                {
                    "%S": VARIABLE_REFERENCE("certName")
                },
            )
        ),

            FTL.Message(
                id=FTL.Identifier("cert-with-serial"),
                attributes=[
                    FTL.Attribute(
                        id=FTL.Identifier("value"),
                        value=REPLACE(
                            "security/manager/chrome/pippki/pippki.properties",
                            "certWithSerial",
                            {
                                "%1$S": VARIABLE_REFERENCE("serialNumber")
                            },
                        )
                    )
                ]
            ),

            FTL.Message(
                id=FTL.Identifier("cert-viewer-title"),
                attributes=[
                    FTL.Attribute(
                        id=FTL.Identifier("title"),
                        value=REPLACE(
                            "security/manager/chrome/pippki/pippki.properties",
                            "certViewerTitle",
                            {
                                "%1$S": VARIABLE_REFERENCE("certName")
                            },
                        )
                    )
                ]
            ),

            FTL.Message(
                id=FTL.Identifier("add-exception-branded-warning"),
                value=REPLACE(
                    "security/manager/chrome/pippki/pippki.properties",
                    "addExceptionBrandedWarning2",
                    {
                        "%S": TERM_REFERENCE("-brand-short-name")
                    },
                )
            ),

            FTL.Message(
                id=FTL.Identifier("certmgr-edit-ca-cert"),
                attributes=[
                    FTL.Attribute(
                        id=FTL.Identifier("title"),
                        value=COPY(
                                "security/manager/chrome/pippki/certManager.dtd",
                                "certmgr.editcacert.title",
                            )
                        ),
                    FTL.Attribute(
                        id=FTL.Identifier("style"),
                        value=CONCAT(
                            FTL.TextElement("width: 48em;"),
                        )
                    )
                ]
            ),

            FTL.Message(
                id=FTL.Identifier("certmgr-delete-cert"),
                attributes=[
                    FTL.Attribute(
                        id=FTL.Identifier("title"),
                        value=COPY(
                                "security/manager/chrome/pippki/certManager.dtd",
                                "certmgr.deletecert.title",
                            )
                        ),
                    FTL.Attribute(
                        id=FTL.Identifier("style"),
                        value=CONCAT(
                            FTL.TextElement("width: 48em; height: 24em;"),
                        )
                    )
                ]
            ),

            FTL.Message(
                id=FTL.Identifier("certmgr-begins-value"),
                attributes=[
                    FTL.Attribute(
                        id=FTL.Identifier("value"),
                        value=FTL.Pattern(
                            elements=[
                                FTL.Placeable(
                                    expression=MESSAGE_REFERENCE("certmgr-begins-label.label")
                                )
                            ]
                        )
                    )
                ]
            ),

            FTL.Message(
                id=FTL.Identifier("certmgr-expires-value"),
                attributes=[
                    FTL.Attribute(
                        id=FTL.Identifier("value"),
                        value=FTL.Pattern(
                            elements=[
                                FTL.Placeable(
                                    expression=MESSAGE_REFERENCE("certmgr-expires-label.label")
                                )
                            ]
                        )
                    )
                ]
            ),
        ]
    )
Esempio n. 20
0
def migrate(ctx):
    """Bug 1491676 - Move strings from preferences.properties to Fluent"""

    ctx.add_transforms(
        "toolkit/toolkit/preferences/preferences.ftl",
        "toolkit/toolkit/preferences/preferences.ftl",
        transforms_from(
            """
password-not-set =
        .value = { COPY(from_path, "password_not_set") }
failed-pw-change = { COPY(from_path, "failed_pw_change") }
incorrect-pw = { COPY(from_path, "incorrect_pw") }
pw-empty-warning = { COPY(from_path, "pw_empty_warning") }
pw-change-ok = { COPY(from_path, "pw_change_ok") }
pw-erased-ok = { COPY(from_path, "pw_erased_ok") } { pw-empty-warning }
pw-not-wanted = { COPY(from_path, "pw_not_wanted") } { pw-empty-warning }
pw-change2empty-in-fips-mode = { COPY(from_path, "pw_change2empty_in_fips_mode") }
pw-change-success-title = { COPY(from_path, "pw_change_success_title") }
pw-change-failed-title = { COPY(from_path, "pw_change_failed_title") }
pw-remove-button =
    .label = { COPY(from_path, "pw_remove_button") }
""",
            from_path=
            "toolkit/chrome/mozapps/preferences/preferences.properties"))

    ctx.add_transforms(
        "browser/browser/preferences/preferences.ftl",
        "browser/browser/preferences/preferences.ftl",
        transforms_from(
            """
space-alert-learn-more-button =
        .label = { COPY(from_path, "spaceAlert.learnMoreButton.label")}
        .accesskey = { COPY(from_path, "spaceAlert.learnMoreButton.accesskey")}
space-alert-under-5gb-ok-button =
        .label = { COPY(from_path, "spaceAlert.under5GB.okButton.label")}
        .accesskey = { COPY(from_path, "spaceAlert.under5GB.okButton.accesskey")}
desktop-folder-name = { COPY(from_path, "desktopFolderName")}
downloads-folder-name = { COPY(from_path, "downloadsFolderName")}
choose-download-folder-title = { COPY(from_path, "chooseDownloadFolderTitle")}
""",
            from_path=
            "browser/chrome/browser/preferences/preferences.properties"))

    ctx.add_transforms(
        "browser/browser/preferences/preferences.ftl",
        "browser/browser/preferences/preferences.ftl",
        [
            FTL.Message(
                id=FTL.Identifier("space-alert-under-5gb-message"),
                value=REPLACE(
                    "browser/chrome/browser/preferences/preferences.properties",
                    "spaceAlert.under5GB.message", {
                        "%S": TERM_REFERENCE("-brand-short-name"),
                    })),
            FTL.Message(
                id=FTL.Identifier("space-alert-over-5gb-pref-button"),
                attributes=[
                    FTL.Attribute(
                        id=FTL.Identifier("label"),
                        value=FTL.Pattern(elements=[
                            FTL.Placeable(expression=FTL.SelectExpression(
                                selector=FTL.CallExpression(
                                    callee=FTL.Function("PLATFORM")),
                                variants=[
                                    FTL.Variant(
                                        key=FTL.Identifier("windows"),
                                        default=False,
                                        value=COPY(
                                            "browser/chrome/browser/preferences/preferences.properties",
                                            "spaceAlert.over5GB.prefButtonWin.label"
                                        )),
                                    FTL.Variant(
                                        key=FTL.Identifier("other"),
                                        default=True,
                                        value=COPY(
                                            "browser/chrome/browser/preferences/preferences.properties",
                                            "spaceAlert.over5GB.prefButton.label"
                                        )),
                                ]))
                        ])),
                    FTL.Attribute(
                        id=FTL.Identifier("accesskey"),
                        value=FTL.Pattern(elements=[
                            FTL.Placeable(expression=FTL.SelectExpression(
                                selector=FTL.CallExpression(
                                    callee=FTL.Function("PLATFORM")),
                                variants=[
                                    FTL.Variant(
                                        key=FTL.Identifier("windows"),
                                        default=False,
                                        value=COPY(
                                            "browser/chrome/browser/preferences/preferences.properties",
                                            "spaceAlert.over5GB.prefButtonWin.accesskey"
                                        )),
                                    FTL.Variant(
                                        key=FTL.Identifier("other"),
                                        default=True,
                                        value=COPY(
                                            "browser/chrome/browser/preferences/preferences.properties",
                                            "spaceAlert.over5GB.prefButton.accesskey"
                                        )),
                                ]))
                        ])),
                ]),
            FTL.Message(
                id=FTL.Identifier("space-alert-over-5gb-message"),
                value=FTL.Pattern(elements=[
                    FTL.Placeable(expression=FTL.SelectExpression(
                        selector=FTL.CallExpression(
                            callee=FTL.Function("PLATFORM")),
                        variants=[
                            FTL.Variant(
                                key=FTL.Identifier("windows"),
                                default=False,
                                value=REPLACE(
                                    "browser/chrome/browser/preferences/preferences.properties",
                                    "spaceAlert.over5GB.messageWin1", {
                                        "%S": TERM_REFERENCE(
                                            "-brand-short-name"),
                                    })),
                            FTL.Variant(
                                key=FTL.Identifier("other"),
                                default=True,
                                value=REPLACE(
                                    "browser/chrome/browser/preferences/preferences.properties",
                                    "spaceAlert.over5GB.message1", {
                                        "%S": TERM_REFERENCE(
                                            "-brand-short-name"),
                                    })),
                        ]))
                ])),
        ],
    )

    ctx.add_transforms(
        "browser/browser/preferences/permissions.ftl",
        "browser/browser/preferences/permissions.ftl",
        transforms_from(
            """
permissions-capabilities-listitem-allow =
    .value = { COPY(from_path, "can")}
permissions-capabilities-listitem-allow-first-party =
    .value = { COPY(from_path, "canAccessFirstParty")}
permissions-capabilities-listitem-allow-session =
    .value = { COPY(from_path, "canSession")}
permissions-capabilities-listitem-block =
    .value = { COPY(from_path, "cannot")}
""",
            from_path=
            "browser/chrome/browser/preferences/preferences.properties"))
Esempio n. 21
0
def migrate(ctx):
    """Bug 1491679 - Convert a subset of the strings in extensions.dtd to using Fluent for localization, part {index}."""

    ctx.add_transforms(
        "toolkit/toolkit/about/aboutAddons.ftl",
        "toolkit/toolkit/about/aboutAddons.ftl",
        transforms_from(
            """
extensions-warning-safe-mode-label =
    .value = { COPY(from_path, "warning.safemode.label") }
extensions-warning-check-compatibility-label =
    .value = { COPY(from_path, "warning.checkcompatibility.label") }
extensions-warning-check-compatibility-enable =
    .label = { COPY(from_path, "warning.checkcompatibility.enable.label") }
    .tooltiptext = { COPY(from_path, "warning.checkcompatibility.enable.tooltip") }
extensions-warning-update-security-label =
    .value = { COPY(from_path, "warning.updatesecurity.label") }
extensions-warning-update-security-enable =
    .label = { COPY(from_path, "warning.updatesecurity.enable.label") }
    .tooltiptext = { COPY(from_path, "warning.updatesecurity.enable.tooltip") }
extensions-updates-check-for-updates =
    .label = { COPY(from_path, "updates.checkForUpdates.label") }
    .accesskey = { COPY(from_path, "updates.checkForUpdates.accesskey") }
extensions-updates-view-updates =
    .label = { COPY(from_path, "updates.viewUpdates.label") }
    .accesskey = { COPY(from_path, "updates.viewUpdates.accesskey") }
extensions-updates-update-addons-automatically =
    .label = { COPY(from_path, "updates.updateAddonsAutomatically.label") }
    .accesskey = { COPY(from_path, "updates.updateAddonsAutomatically.accesskey") }
extensions-updates-reset-updates-to-automatic =
    .label = { COPY(from_path, "updates.resetUpdatesToAutomatic.label") }
    .accesskey = { COPY(from_path, "updates.resetUpdatesToAutomatic.accesskey") }
extensions-updates-reset-updates-to-manual =
    .label = { COPY(from_path, "updates.resetUpdatesToManual.label") }
    .accesskey = { COPY(from_path, "updates.resetUpdatesToManual.accesskey") }
extensions-updates-updating =
    .value = { COPY(from_path, "updates.updating.label") }
extensions-updates-installed =
    .value = { COPY(from_path, "updates.installed.label") }
extensions-updates-downloaded =
    .value = { COPY(from_path, "updates.downloaded.label") }
extensions-updates-restart =
    .label = { COPY(from_path, "updates.restart.label") }
extensions-updates-none-found =
    .value = { COPY(from_path, "updates.noneFound.label") }
extensions-updates-manual-updates-found =
    .label = { COPY(from_path, "updates.manualUpdatesFound.label") }
extensions-updates-update-selected =
    .label = { COPY(from_path, "updates.updateSelected.label") }
    .tooltiptext = { COPY(from_path, "updates.updateSelected.tooltip") }
""",
            from_path="toolkit/chrome/mozapps/extensions/extensions.dtd"))

    ctx.add_transforms(
        "toolkit/toolkit/about/aboutAddons.ftl",
        "toolkit/toolkit/about/aboutAddons.ftl", [
            FTL.Message(
                id=FTL.Identifier("extensions-view-discover"),
                attributes=[
                    FTL.Attribute(
                        id=FTL.Identifier("name"),
                        value=COPY(
                            "toolkit/chrome/mozapps/extensions/extensions.dtd",
                            "view.discover.label")),
                    FTL.Attribute(
                        id=FTL.Identifier("tooltiptext"),
                        value=FTL.Pattern(elements=[
                            FTL.Placeable(expression=MESSAGE_REFERENCE(
                                "extensions-view-discover.name"))
                        ]))
                ]),
            FTL.Message(
                id=FTL.Identifier("extensions-view-recent-updates"),
                attributes=[
                    FTL.Attribute(
                        id=FTL.Identifier("name"),
                        value=COPY(
                            "toolkit/chrome/mozapps/extensions/extensions.dtd",
                            "view.recentUpdates.label")),
                    FTL.Attribute(
                        id=FTL.Identifier("tooltiptext"),
                        value=FTL.Pattern(elements=[
                            FTL.Placeable(expression=MESSAGE_REFERENCE(
                                "extensions-view-recent-updates.name"))
                        ]))
                ]),
            FTL.Message(
                id=FTL.Identifier("extensions-view-available-updates"),
                attributes=[
                    FTL.Attribute(
                        id=FTL.Identifier("name"),
                        value=COPY(
                            "toolkit/chrome/mozapps/extensions/extensions.dtd",
                            "view.availableUpdates.label")),
                    FTL.Attribute(
                        id=FTL.Identifier("tooltiptext"),
                        value=FTL.Pattern(elements=[
                            FTL.Placeable(expression=MESSAGE_REFERENCE(
                                "extensions-view-available-updates.name"))
                        ]))
                ]),
            FTL.Message(
                id=FTL.Identifier("extensions-warning-safe-mode-container"),
                attributes=[
                    FTL.Attribute(
                        id=FTL.Identifier("tooltiptext"),
                        value=FTL.Pattern(elements=[
                            FTL.Placeable(expression=MESSAGE_REFERENCE(
                                "extensions-warning-safe-mode-label.value"))
                        ]))
                ]),
            FTL.Message(
                id=FTL.Identifier(
                    "extensions-warning-check-compatibility-container"),
                attributes=[
                    FTL.Attribute(
                        id=FTL.Identifier("tooltiptext"),
                        value=FTL.Pattern(elements=[
                            FTL.Placeable(expression=MESSAGE_REFERENCE(
                                "extensions-warning-check-compatibility-label.value"
                            ))
                        ]))
                ]),
            FTL.Message(
                id=FTL.Identifier(
                    "extensions-warning-update-security-container"),
                attributes=[
                    FTL.Attribute(
                        id=FTL.Identifier("tooltiptext"),
                        value=FTL.Pattern(elements=[
                            FTL.Placeable(expression=MESSAGE_REFERENCE(
                                "extensions-warning-update-security-label.value"
                            ))
                        ]))
                ]),
        ])
Esempio n. 22
0
def migrate(ctx):
    """Bug 1451992 - Migrate Preferences::Subdialogs::Connection to Fluent, part {index}."""

    ctx.add_transforms(
        'browser/browser/preferences/connection.ftl',
        'browser/browser/preferences/connection.ftl',
        [
            FTL.Message(
                id=FTL.Identifier('connection-window'),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('title'),
                        COPY(
                            'browser/chrome/browser/preferences/connection.dtd',
                            'connectionsDialog.title'
                        )
                    ),
                    FTL.Attribute(
                        FTL.Identifier('style'),
                        FTL.Pattern(
                            elements=[
                                FTL.Placeable(
                                    expression=FTL.SelectExpression(
                                        expression=FTL.CallExpression(
                                            callee=FTL.Function('PLATFORM')
                                        ),
                                        variants=[
                                            FTL.Variant(
                                                key=FTL.VariantName('macos'),
                                                default=False,
                                                value=CONCAT(
                                                    FTL.TextElement('width: '),
                                                    COPY(
                                                        'browser/chrome/browser/preferences/connection.dtd',
                                                        'window.macWidth2'
                                                    )
                                                )
                                            ),
                                            FTL.Variant(
                                                key=FTL.VariantName('other'),
                                                default=True,
                                                value=CONCAT(
                                                    FTL.TextElement('width: '),
                                                    COPY(
                                                        'browser/chrome/browser/preferences/connection.dtd',
                                                        'window.width2'
                                                    )
                                                )
                                            )
                                        ]
                                    )
                                )
                            ]
                        )
                    )
                ]
            ),
            FTL.Message(
                id=FTL.Identifier('connection-close-key'),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('key'),
                        COPY(
                            'toolkit/chrome/global/preferences.dtd',
                            'windowClose.key'
                        )
                    )
                ]
            ),
            FTL.Message(
                id=FTL.Identifier('connection-disable-extension'),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('label'),
                        COPY(
                            'browser/chrome/browser/preferences/main.dtd',
                            'disableExtension.label'
                        )
                    )
                ]
            ),
            FTL.Message(
                id=FTL.Identifier('connection-proxy-configure'),
                value=COPY(
                    'browser/chrome/browser/preferences/connection.dtd',
                    'proxyTitle.label2'
                )
            ),
            FTL.Message(
                id=FTL.Identifier('connection-proxy-option-no'),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('label'),
                        COPY(
                            'browser/chrome/browser/preferences/connection.dtd',
                            'noProxyTypeRadio.label'
                        )
                    ),
                    FTL.Attribute(
                        FTL.Identifier('accesskey'),
                        COPY(
                            'browser/chrome/browser/preferences/connection.dtd',
                            'noProxyTypeRadio.accesskey'
                        )
                    )
                ]
            ),
            FTL.Message(
                id=FTL.Identifier('connection-proxy-option-system'),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('label'),
                        COPY(
                            'browser/chrome/browser/preferences/connection.dtd',
                            'systemTypeRadio.label'
                        )
                    ),
                    FTL.Attribute(
                        FTL.Identifier('accesskey'),
                        COPY(
                            'browser/chrome/browser/preferences/connection.dtd',
                            'systemTypeRadio.accesskey'
                        )
                    )
                ]
            ),
            FTL.Message(
                id=FTL.Identifier('connection-proxy-option-auto'),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('label'),
                        COPY(
                            'browser/chrome/browser/preferences/connection.dtd',
                            'WPADTypeRadio.label'
                        )
                    ),
                    FTL.Attribute(
                        FTL.Identifier('accesskey'),
                        COPY(
                            'browser/chrome/browser/preferences/connection.dtd',
                            'WPADTypeRadio.accesskey'
                        )
                    )
                ]
            ),
            FTL.Message(
                id=FTL.Identifier('connection-proxy-option-manual'),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('label'),
                        COPY(
                            'browser/chrome/browser/preferences/connection.dtd',
                            'manualTypeRadio2.label'
                        )
                    ),
                    FTL.Attribute(
                        FTL.Identifier('accesskey'),
                        COPY(
                            'browser/chrome/browser/preferences/connection.dtd',
                            'manualTypeRadio2.accesskey'
                        )
                    )
                ]
            ),
            FTL.Message(
                id=FTL.Identifier('connection-proxy-http'),
                value=COPY(
                    'browser/chrome/browser/preferences/connection.dtd',
                    'http2.label'
                ),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('accesskey'),
                        COPY(
                            'browser/chrome/browser/preferences/connection.dtd',
                            'http2.accesskey'
                        )
                    )
                ]
            ),
            FTL.Message(
                id=FTL.Identifier('connection-proxy-http-port'),
                value=COPY(
                    'browser/chrome/browser/preferences/connection.dtd',
                    'port2.label'
                ),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('accesskey'),
                        COPY(
                            'browser/chrome/browser/preferences/connection.dtd',
                            'HTTPport.accesskey'
                        )
                    )
                ]
            ),
            FTL.Message(
                id=FTL.Identifier('connection-proxy-http-share'),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('label'),
                        COPY(
                            'browser/chrome/browser/preferences/connection.dtd',
                            'shareproxy.label'
                        )
                    ),
                    FTL.Attribute(
                        FTL.Identifier('accesskey'),
                        COPY(
                            'browser/chrome/browser/preferences/connection.dtd',
                            'shareproxy.accesskey'
                        )
                    )
                ]
            ),
            FTL.Message(
                id=FTL.Identifier('connection-proxy-ssl'),
                value=COPY(
                    'browser/chrome/browser/preferences/connection.dtd',
                    'ssl2.label'
                ),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('accesskey'),
                        COPY(
                            'browser/chrome/browser/preferences/connection.dtd',
                            'ssl2.accesskey'
                        )
                    )
                ]
            ),
            FTL.Message(
                id=FTL.Identifier('connection-proxy-ssl-port'),
                value=COPY(
                    'browser/chrome/browser/preferences/connection.dtd',
                    'port2.label'
                ),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('accesskey'),
                        COPY(
                            'browser/chrome/browser/preferences/connection.dtd',
                            'SSLport.accesskey'
                        )
                    )
                ]
            ),
            FTL.Message(
                id=FTL.Identifier('connection-proxy-ftp'),
                value=COPY(
                    'browser/chrome/browser/preferences/connection.dtd',
                    'ftp2.label'
                ),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('accesskey'),
                        COPY(
                            'browser/chrome/browser/preferences/connection.dtd',
                            'ftp2.accesskey'
                        )
                    )
                ]
            ),
            FTL.Message(
                id=FTL.Identifier('connection-proxy-ftp-port'),
                value=COPY(
                    'browser/chrome/browser/preferences/connection.dtd',
                    'port2.label'
                ),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('accesskey'),
                        COPY(
                            'browser/chrome/browser/preferences/connection.dtd',
                            'FTPport.accesskey'
                        )
                    )
                ]
            ),
            FTL.Message(
                id=FTL.Identifier('connection-proxy-socks'),
                value=COPY(
                    'browser/chrome/browser/preferences/connection.dtd',
                    'socks2.label'
                ),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('accesskey'),
                        COPY(
                            'browser/chrome/browser/preferences/connection.dtd',
                            'socks2.accesskey'
                        )
                    )
                ]
            ),
            FTL.Message(
                id=FTL.Identifier('connection-proxy-socks-port'),
                value=COPY(
                    'browser/chrome/browser/preferences/connection.dtd',
                    'port2.label'
                ),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('accesskey'),
                        COPY(
                            'browser/chrome/browser/preferences/connection.dtd',
                            'SOCKSport.accesskey'
                        )
                    )
                ]
            ),
            FTL.Message(
                id=FTL.Identifier('connection-proxy-socks4'),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('label'),
                        COPY(
                            'browser/chrome/browser/preferences/connection.dtd',
                            'socks4.label'
                        )
                    ),
                    FTL.Attribute(
                        FTL.Identifier('accesskey'),
                        COPY(
                            'browser/chrome/browser/preferences/connection.dtd',
                            'socks4.accesskey'
                        )
                    )
                ]
            ),
            FTL.Message(
                id=FTL.Identifier('connection-proxy-socks5'),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('label'),
                        COPY(
                            'browser/chrome/browser/preferences/connection.dtd',
                            'socks5.label'
                        )
                    ),
                    FTL.Attribute(
                        FTL.Identifier('accesskey'),
                        COPY(
                            'browser/chrome/browser/preferences/connection.dtd',
                            'socks5.accesskey'
                        )
                    )
                ]
            ),
            FTL.Message(
                id=FTL.Identifier('connection-proxy-noproxy'),
                value=COPY(
                    'browser/chrome/browser/preferences/connection.dtd',
                    'noproxy2.label'
                ),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('accesskey'),
                        COPY(
                            'browser/chrome/browser/preferences/connection.dtd',
                            'noproxy2.accesskey'
                        )
                    )
                ]
            ),
            FTL.Message(
                id=FTL.Identifier('connection-proxy-noproxy-desc'),
                value=COPY(
                    'browser/chrome/browser/preferences/connection.dtd',
                    'noproxyExplain.label'
                )
            ),
            FTL.Message(
                id=FTL.Identifier('connection-proxy-autotype'),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('label'),
                        COPY(
                            'browser/chrome/browser/preferences/connection.dtd',
                            'autoTypeRadio2.label'
                        )
                    ),
                    FTL.Attribute(
                        FTL.Identifier('accesskey'),
                        COPY(
                            'browser/chrome/browser/preferences/connection.dtd',
                            'autoTypeRadio2.accesskey'
                        )
                    )
                ]
            ),
            FTL.Message(
                id=FTL.Identifier('connection-proxy-reload'),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('label'),
                        COPY(
                            'browser/chrome/browser/preferences/connection.dtd',
                            'reload.label'
                        )
                    ),
                    FTL.Attribute(
                        FTL.Identifier('accesskey'),
                        COPY(
                            'browser/chrome/browser/preferences/connection.dtd',
                            'reload.accesskey'
                        )
                    )
                ]
            ),
            FTL.Message(
                id=FTL.Identifier('connection-proxy-autologin'),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('label'),
                        COPY(
                            'browser/chrome/browser/preferences/connection.dtd',
                            'autologinproxy.label'
                        )
                    ),
                    FTL.Attribute(
                        FTL.Identifier('accesskey'),
                        COPY(
                            'browser/chrome/browser/preferences/connection.dtd',
                            'autologinproxy.accesskey'
                        )
                    ),
                    FTL.Attribute(
                        FTL.Identifier('tooltip'),
                        COPY(
                            'browser/chrome/browser/preferences/connection.dtd',
                            'autologinproxy.tooltip'
                        )
                    )
                ]
            ),
            FTL.Message(
                id=FTL.Identifier('connection-proxy-socks-remote-dns'),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('label'),
                        COPY(
                            'browser/chrome/browser/preferences/connection.dtd',
                            'socksRemoteDNS.label2'
                        )
                    ),
                    FTL.Attribute(
                        FTL.Identifier('accesskey'),
                        COPY(
                            'browser/chrome/browser/preferences/connection.dtd',
                            'socksRemoteDNS.accesskey'
                        )
                    )
                ]
            )
        ]
    )
def pattern_from_text(value):
    return FTL.Pattern([
        FTL.TextElement(value)
    ])
def migrate(ctx):
    """Bug 1451992 - Migrate Preferences::Subdialogs::Colors to Fluent, part {index}."""

    ctx.add_transforms(
        'browser/browser/preferences/colors.ftl',
        'browser/browser/preferences/colors.ftl', [
            FTL.Message(
                id=FTL.Identifier('colors-window'),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('title'),
                        COPY('browser/chrome/browser/preferences/colors.dtd',
                             'colorsDialog.title')),
                    FTL.Attribute(
                        FTL.Identifier('style'),
                        FTL.Pattern(elements=[
                            FTL.Placeable(expression=FTL.SelectExpression(
                                expression=FTL.CallExpression(
                                    callee=FTL.Function('PLATFORM')),
                                variants=[
                                    FTL.Variant(
                                        key=FTL.VariantName('macos'),
                                        default=False,
                                        value=CONCAT(
                                            FTL.TextElement('width: '),
                                            COPY(
                                                'browser/chrome/browser/preferences/colors.dtd',
                                                'window.macWidth'))),
                                    FTL.Variant(
                                        key=FTL.VariantName('other'),
                                        default=True,
                                        value=CONCAT(
                                            FTL.TextElement('width: '),
                                            COPY(
                                                'browser/chrome/browser/preferences/colors.dtd',
                                                'window.width')))
                                ]))
                        ]))
                ]),
            FTL.Message(id=FTL.Identifier('colors-close-key'),
                        attributes=[
                            FTL.Attribute(
                                FTL.Identifier('key'),
                                COPY('toolkit/chrome/global/preferences.dtd',
                                     'windowClose.key'))
                        ]),
            FTL.Message(
                id=FTL.Identifier('colors-page-override'),
                value=COPY('browser/chrome/browser/preferences/colors.dtd',
                           'overrideDefaultPageColors2.label'),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('accesskey'),
                        COPY('browser/chrome/browser/preferences/colors.dtd',
                             'overrideDefaultPageColors2.accesskey'))
                ]),
            FTL.Message(
                id=FTL.Identifier('colors-page-override-option-always'),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('label'),
                        COPY('browser/chrome/browser/preferences/colors.dtd',
                             'overrideDefaultPageColors.always.label'))
                ]),
            FTL.Message(
                id=FTL.Identifier('colors-page-override-option-auto'),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('label'),
                        COPY('browser/chrome/browser/preferences/colors.dtd',
                             'overrideDefaultPageColors.auto.label'))
                ]),
            FTL.Message(
                id=FTL.Identifier('colors-page-override-option-never'),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('label'),
                        COPY('browser/chrome/browser/preferences/colors.dtd',
                             'overrideDefaultPageColors.never.label'),
                    ),
                ],
            ),
            FTL.Message(id=FTL.Identifier('colors-text-and-background'),
                        value=COPY(
                            'browser/chrome/browser/preferences/colors.dtd',
                            'color')),
            FTL.Message(
                id=FTL.Identifier('colors-text-header'),
                value=COPY('browser/chrome/browser/preferences/colors.dtd',
                           'textColor2.label'),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('accesskey'),
                        COPY('browser/chrome/browser/preferences/colors.dtd',
                             'textColor2.accesskey'))
                ]),
            FTL.Message(
                id=FTL.Identifier('colors-background'),
                value=COPY('browser/chrome/browser/preferences/colors.dtd',
                           'backgroundColor2.label'),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('accesskey'),
                        COPY('browser/chrome/browser/preferences/colors.dtd',
                             'backgroundColor2.accesskey'))
                ]),
            FTL.Message(
                id=FTL.Identifier('colors-use-system'),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('label'),
                        COPY('browser/chrome/browser/preferences/colors.dtd',
                             'useSystemColors.label')),
                    FTL.Attribute(
                        FTL.Identifier('accesskey'),
                        COPY('browser/chrome/browser/preferences/colors.dtd',
                             'useSystemColors.accesskey'))
                ]),
            FTL.Message(
                id=FTL.Identifier('colors-underline-links'),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('label'),
                        COPY('browser/chrome/browser/preferences/colors.dtd',
                             'underlineLinks.label')),
                    FTL.Attribute(
                        FTL.Identifier('accesskey'),
                        COPY('browser/chrome/browser/preferences/colors.dtd',
                             'underlineLinks.accesskey'))
                ]),
            FTL.Message(id=FTL.Identifier('colors-links-header'),
                        value=COPY(
                            'browser/chrome/browser/preferences/colors.dtd',
                            'links')),
            FTL.Message(
                id=FTL.Identifier('colors-unvisited-links'),
                value=COPY('browser/chrome/browser/preferences/colors.dtd',
                           'linkColor2.label'),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('accesskey'),
                        COPY('browser/chrome/browser/preferences/colors.dtd',
                             'linkColor2.accesskey'))
                ]),
            FTL.Message(
                id=FTL.Identifier('colors-visited-links'),
                value=COPY('browser/chrome/browser/preferences/colors.dtd',
                           'visitedLinkColor2.label'),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('accesskey'),
                        COPY('browser/chrome/browser/preferences/colors.dtd',
                             'visitedLinkColor2.accesskey'))
                ])
        ])
Esempio n. 25
0
def migrate(ctx):
    """Bug 1491677 -  Migrate subsection of strings of extensions.dtd, part {index}"""

    ctx.add_transforms(
        "toolkit/toolkit/about/aboutAddons.ftl",
        "toolkit/toolkit/about/aboutAddons.ftl",
        transforms_from("""
addons-window =
    .title = { COPY("toolkit/chrome/mozapps/extensions/extensions.dtd", "addons.windowTitle")}
search-header =
    .placeholder = { COPY("toolkit/chrome/mozapps/extensions/extensions.dtd", "search.placeholder3")}
    .searchbuttonlabel = { COPY("toolkit/chrome/mozapps/extensions/extensions.dtd", "search.buttonlabel")}
search-header-shortcut =
    .key = { COPY("toolkit/chrome/mozapps/extensions/extensions.dtd", "search.commandkey")}
loading-label =
    .value = { COPY("toolkit/chrome/mozapps/extensions/extensions.dtd", "loading.label")}
list-empty-installed =
    .value = { COPY("toolkit/chrome/mozapps/extensions/extensions.dtd", "listEmpty.installed.label")}
list-empty-available-updates =
    .value ={ COPY("toolkit/chrome/mozapps/extensions/extensions.dtd", "listEmpty.availableUpdates.label")}
list-empty-recent-updates =
    .value = { COPY("toolkit/chrome/mozapps/extensions/extensions.dtd", "listEmpty.recentUpdates.label")}
list-empty-find-updates =
    .label = { COPY("toolkit/chrome/mozapps/extensions/extensions.dtd", "listEmpty.findUpdates.label")}
list-empty-button =
    .label = { COPY("toolkit/chrome/mozapps/extensions/extensions.dtd", "listEmpty.button.label")}
install-addon-from-file =
    .label = { COPY("toolkit/chrome/mozapps/extensions/extensions.dtd", "installAddonFromFile.label")}
    .accesskey = { COPY("toolkit/chrome/mozapps/extensions/extensions.dtd", "installAddonFromFile.accesskey")}
help-button = { COPY("toolkit/chrome/mozapps/extensions/extensions.dtd", "helpButton.label")}
tools-menu =
    .tooltiptext = { COPY("toolkit/chrome/mozapps/extensions/extensions.dtd", "toolsMenu.tooltip")}
show-unsigned-extensions-button =
    .label = { COPY("toolkit/chrome/mozapps/extensions/extensions.dtd", "showUnsignedExtensions.button.label")}
show-all-extensions-button =
    .label = { COPY("toolkit/chrome/mozapps/extensions/extensions.dtd", "showAllExtensions.button.label")}
debug-addons =
    .label = { COPY("toolkit/chrome/mozapps/extensions/extensions.dtd", "debugAddons.label")}
    .accesskey = { COPY("toolkit/chrome/mozapps/extensions/extensions.dtd", "debugAddons.accesskey")}
cmd-show-details =
    .label = { COPY("toolkit/chrome/mozapps/extensions/extensions.dtd", "cmd.showDetails.label")}
    .accesskey = { COPY("toolkit/chrome/mozapps/extensions/extensions.dtd", "cmd.showDetails.accesskey")}
cmd-find-updates =
    .label = { COPY("toolkit/chrome/mozapps/extensions/extensions.dtd", "cmd.findUpdates.label")}
    .accesskey = { COPY("toolkit/chrome/mozapps/extensions/extensions.dtd", "cmd.findUpdates.accesskey")}
cmd-enable-theme =
    .label = { COPY("toolkit/chrome/mozapps/extensions/extensions.dtd", "cmd.enableTheme.label")}
    .accesskey = { COPY("toolkit/chrome/mozapps/extensions/extensions.dtd", "cmd.enableTheme.accesskey")}
cmd-disable-theme =
    .label = { COPY("toolkit/chrome/mozapps/extensions/extensions.dtd", "cmd.disableTheme.label")}
    .accesskey = { COPY("toolkit/chrome/mozapps/extensions/extensions.dtd", "cmd.disableTheme.accesskey")}
cmd-install-addon =
    .label = { COPY("toolkit/chrome/mozapps/extensions/extensions.dtd", "cmd.installAddon.label")}
    .accesskey = { COPY("toolkit/chrome/mozapps/extensions/extensions.dtd", "cmd.installAddon.accesskey")}
cmd-contribute =
    .label = { COPY("toolkit/chrome/mozapps/extensions/extensions.dtd", "cmd.contribute.label")}
    .accesskey = { COPY("toolkit/chrome/mozapps/extensions/extensions.dtd", "cmd.contribute.accesskey")}
    .tooltiptext = { COPY("toolkit/chrome/mozapps/extensions/extensions.dtd", "cmd.contribute.tooltip")}
discover-title = { COPY("toolkit/chrome/mozapps/extensions/extensions.dtd", "discover.title")}
discover-footer = { COPY("toolkit/chrome/mozapps/extensions/extensions.dtd", "discover.footer", trim:"True")}
detail-version =
    .label = { COPY("toolkit/chrome/mozapps/extensions/extensions.dtd", "detail.version.label")}
detail-last-updated =
    .label = { COPY("toolkit/chrome/mozapps/extensions/extensions.dtd", "detail.lastupdated.label")}
detail-contributions-description = { COPY("toolkit/chrome/mozapps/extensions/extensions.dtd", "detail.contributions.description")}
detail-update-type =
    .value = { COPY("toolkit/chrome/mozapps/extensions/extensions.dtd", "detail.updateType")}
detail-update-default =
    .label = { COPY("toolkit/chrome/mozapps/extensions/extensions.dtd", "detail.updateDefault.label")}
    .tooltiptext = { COPY("toolkit/chrome/mozapps/extensions/extensions.dtd", "detail.updateDefault.tooltip")}
detail-update-automatic =
    .label = { COPY("toolkit/chrome/mozapps/extensions/extensions.dtd", "detail.updateAutomatic.label")}
    .tooltiptext = { COPY("toolkit/chrome/mozapps/extensions/extensions.dtd", "detail.updateAutomatic.tooltip")}
detail-update-manual =
    .label = { COPY("toolkit/chrome/mozapps/extensions/extensions.dtd", "detail.updateManual.label")}
    .tooltiptext = { COPY("toolkit/chrome/mozapps/extensions/extensions.dtd", "detail.updateManual.tooltip")}
detail-home =
    .label ={ COPY("toolkit/chrome/mozapps/extensions/extensions.dtd", "detail.home")}
detail-repository =
    .label = { COPY("toolkit/chrome/mozapps/extensions/extensions.dtd", "detail.repository")}
detail-check-for-updates =
    .label = { COPY("toolkit/chrome/mozapps/extensions/extensions.dtd", "detail.checkForUpdates.label")}
    .accesskey = { COPY("toolkit/chrome/mozapps/extensions/extensions.dtd", "detail.checkForUpdates.accesskey")}
    .tooltiptext = { COPY("toolkit/chrome/mozapps/extensions/extensions.dtd", "detail.checkForUpdates.tooltip")}
detail-rating =
    .value = { COPY("toolkit/chrome/mozapps/extensions/extensions.dtd", "rating2.label")}
addon-restart-now =
    .label = { COPY("toolkit/chrome/mozapps/extensions/extensions.dtd", "addon.restartNow.label")}
disabled-unsigned-heading =
    .value = { COPY("toolkit/chrome/mozapps/extensions/extensions.dtd", "disabledUnsigned.heading")}
disabled-unsigned-learn-more = { COPY("toolkit/chrome/mozapps/extensions/extensions.dtd", "disabledUnsigned.learnMore")}
legacy-warning-show-legacy = { COPY("toolkit/chrome/mozapps/extensions/extensions.dtd", "legacyWarning.showLegacy")}
legacy-extensions =
    .value = { COPY("toolkit/chrome/mozapps/extensions/extensions.dtd", "legacyExtensions.title")}
"""))

    ctx.add_transforms(
        "toolkit/toolkit/about/aboutAddons.ftl",
        "toolkit/toolkit/about/aboutAddons.ftl", [
            FTL.Message(
                id=FTL.Identifier("preferences"),
                value=FTL.Pattern(elements=[
                    FTL.Placeable(expression=FTL.SelectExpression(
                        selector=FTL.CallExpression(callee=FTL.Function(
                            "PLATFORM"), ),
                        variants=[
                            FTL.Variant(
                                key=FTL.Identifier("windows"),
                                default=False,
                                value=REPLACE(
                                    "toolkit/chrome/mozapps/extensions/extensions.dtd",
                                    "preferencesWin.label", {
                                        "&brandShortName;":
                                        TERM_REFERENCE("-brand-short-name")
                                    })),
                            FTL.Variant(
                                key=FTL.Identifier("other"),
                                default=True,
                                value=REPLACE(
                                    "toolkit/chrome/mozapps/extensions/extensions.dtd",
                                    "preferencesUnix.label", {
                                        "&brandShortName;":
                                        TERM_REFERENCE("-brand-short-name")
                                    }))
                        ]))
                ])),
            FTL.Message(
                id=FTL.Identifier("cmd-preferences"),
                attributes=[
                    FTL.Attribute(
                        id=FTL.Identifier("label"),
                        value=FTL.Pattern(elements=[
                            FTL.Placeable(expression=FTL.SelectExpression(
                                selector=FTL.CallExpression(
                                    callee=FTL.Function("PLATFORM"), ),
                                variants=[
                                    FTL.Variant(
                                        key=FTL.Identifier("windows"),
                                        default=False,
                                        value=COPY(
                                            "toolkit/chrome/mozapps/extensions/extensions.dtd",
                                            "cmd.preferencesWin.label")),
                                    FTL.Variant(
                                        key=FTL.Identifier("other"),
                                        default=True,
                                        value=COPY(
                                            "toolkit/chrome/mozapps/extensions/extensions.dtd",
                                            "cmd.preferencesUnix.label"))
                                ]))
                        ])),
                    FTL.Attribute(
                        id=FTL.Identifier("accesskey"),
                        value=FTL.Pattern(elements=[
                            FTL.Placeable(expression=FTL.SelectExpression(
                                selector=FTL.CallExpression(
                                    callee=FTL.Function("PLATFORM"), ),
                                variants=[
                                    FTL.Variant(
                                        key=FTL.Identifier("windows"),
                                        default=False,
                                        value=COPY(
                                            "toolkit/chrome/mozapps/extensions/extensions.dtd",
                                            "cmd.preferencesWin.accesskey")),
                                    FTL.Variant(
                                        key=FTL.Identifier("other"),
                                        default=True,
                                        value=COPY(
                                            "toolkit/chrome/mozapps/extensions/extensions.dtd",
                                            "cmd.preferencesUnix.accesskey"))
                                ]))
                        ]))
                ]),
            FTL.Message(
                id=FTL.Identifier("discover-description"),
                value=REPLACE(
                    "toolkit/chrome/mozapps/extensions/extensions.dtd",
                    "discover.description2",
                    {"&brandShortName;": TERM_REFERENCE("-brand-short-name")},
                    trim=True)),
            FTL.Message(id=FTL.Identifier("detail-home-value"),
                        attributes=[
                            FTL.Attribute(
                                id=FTL.Identifier("value"),
                                value=FTL.Pattern(elements=[
                                    FTL.Placeable(expression=MESSAGE_REFERENCE(
                                        "detail-home.label"))
                                ]))
                        ]),
            FTL.Message(id=FTL.Identifier("detail-repository-value"),
                        attributes=[
                            FTL.Attribute(
                                id=FTL.Identifier("value"),
                                value=FTL.Pattern(elements=[
                                    FTL.Placeable(expression=MESSAGE_REFERENCE(
                                        "detail-repository.label"))
                                ]))
                        ]),
            FTL.Message(
                id=FTL.Identifier("detail-show-preferences"),
                attributes=[
                    FTL.Attribute(
                        id=FTL.Identifier("label"),
                        value=FTL.Pattern(elements=[
                            FTL.Placeable(expression=FTL.SelectExpression(
                                selector=FTL.CallExpression(
                                    callee=FTL.Function("PLATFORM"), ),
                                variants=[
                                    FTL.Variant(
                                        key=FTL.Identifier("windows"),
                                        default=False,
                                        value=COPY(
                                            "toolkit/chrome/mozapps/extensions/extensions.dtd",
                                            "detail.showPreferencesWin.label")
                                    ),
                                    FTL.Variant(
                                        key=FTL.Identifier("other"),
                                        default=True,
                                        value=COPY(
                                            "toolkit/chrome/mozapps/extensions/extensions.dtd",
                                            "detail.showPreferencesUnix.label")
                                    )
                                ]))
                        ])),
                    FTL.Attribute(
                        id=FTL.Identifier("accesskey"),
                        value=FTL.Pattern(elements=[
                            FTL.Placeable(expression=FTL.SelectExpression(
                                selector=FTL.CallExpression(
                                    callee=FTL.Function("PLATFORM"), ),
                                variants=[
                                    FTL.Variant(
                                        key=FTL.Identifier("windows"),
                                        default=False,
                                        value=COPY(
                                            "toolkit/chrome/mozapps/extensions/extensions.dtd",
                                            "detail.showPreferencesWin.accesskey"
                                        )),
                                    FTL.Variant(
                                        key=FTL.Identifier("other"),
                                        default=True,
                                        value=COPY(
                                            "toolkit/chrome/mozapps/extensions/extensions.dtd",
                                            "detail.showPreferencesUnix.accesskey"
                                        ))
                                ]))
                        ])),
                    FTL.Attribute(
                        id=FTL.Identifier("tooltiptext"),
                        value=FTL.Pattern(elements=[
                            FTL.Placeable(expression=FTL.SelectExpression(
                                selector=FTL.CallExpression(
                                    callee=FTL.Function("PLATFORM"), ),
                                variants=[
                                    FTL.Variant(
                                        key=FTL.Identifier("windows"),
                                        default=False,
                                        value=COPY(
                                            "toolkit/chrome/mozapps/extensions/extensions.dtd",
                                            "detail.showPreferencesWin.tooltip"
                                        )),
                                    FTL.Variant(
                                        key=FTL.Identifier("other"),
                                        default=True,
                                        value=COPY(
                                            "toolkit/chrome/mozapps/extensions/extensions.dtd",
                                            "detail.showPreferencesUnix.tooltip"
                                        ))
                                ]))
                        ]))
                ]),
            FTL.Message(
                id=FTL.Identifier("disabled-unsigned-description"),
                value=CONCAT(
                    REPLACE("toolkit/chrome/mozapps/extensions/extensions.dtd",
                            "disabledUnsigned.description.start", {
                                "&brandShortName;":
                                TERM_REFERENCE("-brand-short-name")
                            }),
                    FTL.TextElement('<label data-l10n-name="find-addons">'),
                    COPY("toolkit/chrome/mozapps/extensions/extensions.dtd",
                         "disabledUnsigned.description.findAddonsLink"),
                    FTL.TextElement("</label>"),
                    COPY("toolkit/chrome/mozapps/extensions/extensions.dtd",
                         "disabledUnsigned.description.end"))),
            FTL.Message(
                id=FTL.Identifier("disabled-unsigned-devinfo"),
                value=CONCAT(
                    COPY("toolkit/chrome/mozapps/extensions/extensions.dtd",
                         "disabledUnsigned.devInfo.start"),
                    FTL.TextElement('<label data-l10n-name="learn-more">'),
                    COPY("toolkit/chrome/mozapps/extensions/extensions.dtd",
                         "disabledUnsigned.devInfo.linkToManual"),
                    FTL.TextElement("</label>"),
                    COPY("toolkit/chrome/mozapps/extensions/extensions.dtd",
                         "disabledUnsigned.devInfo.end"))),
            FTL.Message(
                id=FTL.Identifier("plugin-deprecation-description"),
                value=CONCAT(
                    REPLACE("toolkit/chrome/mozapps/extensions/extensions.dtd",
                            "pluginDeprecation.description", {
                                "&brandShortName;":
                                TERM_REFERENCE("-brand-short-name")
                            }),
                    FTL.TextElement(' <label data-l10n-name="learn-more">'),
                    COPY("toolkit/chrome/mozapps/extensions/extensions.dtd",
                         "pluginDeprecation.learnMore"),
                    FTL.TextElement("</label>"))),
            FTL.Message(
                id=FTL.Identifier("legacy-extensions-description"),
                value=CONCAT(
                    REPLACE("toolkit/chrome/mozapps/extensions/extensions.dtd",
                            "legacyExtensions.description", {
                                "&brandShortName;":
                                TERM_REFERENCE("-brand-short-name")
                            }),
                    FTL.TextElement(
                        ' <label data-l10n-name="legacy-learn-more">'),
                    COPY("toolkit/chrome/mozapps/extensions/extensions.dtd",
                         "legacyExtensions.learnMore"),
                    FTL.TextElement("</label>")))
        ])
Esempio n. 26
0
def LITERAL(value):
    """Create a Pattern with a single TextElement."""
    elements = [FTL.TextElement(value)]
    return FTL.Pattern(elements)
Esempio n. 27
0
def migrate(ctx):
    """Bug 1453480 - Migrate Fluent resources to use DOM Overlays, part {index}."""

    ctx.add_transforms(
        'browser/browser/preferences/preferences.ftl',
        'browser/browser/preferences/preferences.ftl', [
            FTL.Message(
                id=FTL.Identifier('search-results-empty-message'),
                value=FTL.Pattern(elements=[
                    FTL.Placeable(expression=FTL.SelectExpression(
                        expression=FTL.CallExpression(
                            callee=FTL.Function('PLATFORM')),
                        variants=[
                            FTL.Variant(
                                key=FTL.VariantName('windows'),
                                default=False,
                                value=REPLACE(
                                    'browser/chrome/browser/preferences/preferences.properties',
                                    'searchResults.sorryMessageWin', {
                                        '%S':
                                        FTL.TextElement(
                                            '<span data-l10n-name="query"></span>'
                                        )
                                    })),
                            FTL.Variant(
                                key=FTL.VariantName('other'),
                                default=True,
                                value=REPLACE(
                                    'browser/chrome/browser/preferences/preferences.properties',
                                    'searchResults.sorryMessageUnix', {
                                        '%S':
                                        FTL.TextElement(
                                            '<span data-l10n-name="query"></span>'
                                        )
                                    }))
                        ]))
                ])),
            FTL.Message(
                id=FTL.Identifier('search-results-help-link'),
                value=REPLACE(
                    'browser/chrome/browser/preferences/preferences.properties',
                    'searchResults.needHelp3', {
                        '%S':
                        CONCAT(
                            FTL.TextElement('<a data-l10n-name="url">'),
                            REPLACE(
                                'browser/chrome/browser/preferences/preferences.properties',
                                'searchResults.needHelpSupportLink', {
                                    '%S':
                                    MESSAGE_REFERENCE('-brand-short-name'),
                                }), FTL.TextElement('</a>'))
                    })),
            FTL.Message(
                id=FTL.Identifier('update-application-version'),
                value=CONCAT(
                    COPY('browser/chrome/browser/preferences/advanced.dtd',
                         'updateApplication.version.pre'),
                    EXTERNAL_ARGUMENT('version'),
                    COPY('browser/chrome/browser/preferences/advanced.dtd',
                         'updateApplication.version.post'),
                    FTL.TextElement(' <a data-l10n-name="learn-more">'),
                    COPY('browser/chrome/browser/aboutDialog.dtd',
                         'releaseNotes.link'), FTL.TextElement('</a>'))),
            FTL.Message(
                id=FTL.Identifier(
                    'performance-limit-content-process-blocked-desc'),
                value=CONCAT(
                    REPLACE('browser/chrome/browser/preferences/advanced.dtd',
                            'limitContentProcessOption.disabledDescription', {
                                '&brandShortName;':
                                MESSAGE_REFERENCE('-brand-short-name')
                            }),
                    FTL.TextElement(' <a data-l10n-name="learn-more">'),
                    COPY('browser/chrome/browser/preferences/advanced.dtd',
                         'limitContentProcessOption.disabledDescriptionLink'),
                    FTL.TextElement('</a>'))),
            FTL.Message(
                id=FTL.Identifier('tracking-desc'),
                value=CONCAT(
                    COPY('browser/chrome/browser/preferences/privacy.dtd',
                         'trackingProtection3.description'),
                    FTL.TextElement(' <a data-l10n-name="learn-more">'),
                    COPY('browser/chrome/browser/preferences/privacy.dtd',
                         'trackingProtectionLearnMore2.label'),
                    FTL.TextElement('</a>'))),
        ])
Esempio n. 28
0
def migrate(ctx):
    """Bug 1568133 - Migrate remaining menubar from dtd to ftl, part {index}"""

    ctx.add_transforms(
        "browser/browser/menubar.ftl",
        "browser/browser/menubar.ftl",
        transforms_from(
            """
menu-application-services =
    .label = { COPY(base_path, "servicesMenuMac.label") }
menu-application-hide-other =
    .label = { COPY(base_path, "hideOtherAppsCmdMac.label") }
menu-application-show-all =
    .label = { COPY(base_path, "showAllAppsCmdMac.label") }
menu-application-touch-bar =
    .label = { COPY(base_path, "touchBarCmdMac.label") }

menu-quit =
    .label =
        { PLATFORM() ->
            [windows] { COPY(browser_path, "quitApplicationCmdWin2.label") }
           *[other] { COPY(browser_path, "quitApplicationCmd.label") }
        }
    .accesskey =
        { PLATFORM() ->
            [windows] { COPY(browser_path, "quitApplicationCmdWin2.accesskey") }
           *[other] { COPY(browser_path, "quitApplicationCmd.accesskey") }
        }

menu-quit-button =
    .label = { menu-quit.label }
""",
            base_path="browser/chrome/browser/baseMenuOverlay.dtd",
            browser_path="browser/chrome/browser/browser.dtd",
        ),
    )

    ctx.add_transforms(
        "browser/browser/menubar.ftl",
        "browser/browser/menubar.ftl",
        [
            FTL.Message(
                id=FTL.Identifier("menu-application-hide-this"),
                attributes=[
                    FTL.Attribute(
                        id=FTL.Identifier("label"),
                        value=REPLACE(
                            "browser/chrome/browser/baseMenuOverlay.dtd",
                            "hideThisAppCmdMac2.label",
                            {
                                "&brandShorterName;": TERM_REFERENCE(
                                    "brand-shorter-name"
                                ),
                            },
                        ),
                    )
                ],
            ),
            FTL.Message(
                id=FTL.Identifier("menu-quit-mac"),
                attributes=[
                    FTL.Attribute(
                        id=FTL.Identifier("label"),
                        value=REPLACE(
                            "browser/chrome/browser/browser.dtd",
                            "quitApplicationCmdMac2.label",
                            {
                                "&brandShorterName;": TERM_REFERENCE(
                                    "brand-shorter-name"
                                ),
                            },
                        ),
                    )
                ],
            ),
            FTL.Message(
                id=FTL.Identifier("menu-quit-button-win"),
                attributes=[
                    FTL.Attribute(
                        id=FTL.Identifier("label"),
                        value=FTL.Pattern(
                            elements=[
                                FTL.Placeable(
                                    expression=FTL.MessageReference(
                                        id=FTL.Identifier("menu-quit"),
                                        attribute=FTL.Identifier("label"),
                                    )
                                )
                            ]
                        ),
                    ),
                    FTL.Attribute(
                        id=FTL.Identifier("tooltip"),
                        value=REPLACE(
                            "browser/chrome/browser/browser.dtd",
                            "quitApplicationCmdWin2.tooltip",
                            {
                                "&brandShorterName;": TERM_REFERENCE(
                                    "brand-shorter-name"
                                ),
                            },
                        ),
                    ),
                ],
            ),
            FTL.Message(
                id=FTL.Identifier("menu-about"),
                attributes=[
                    FTL.Attribute(
                        id=FTL.Identifier("label"),
                        value=REPLACE(
                            "browser/chrome/browser/baseMenuOverlay.dtd",
                            "aboutProduct2.label",
                            {
                                "&brandShorterName;": TERM_REFERENCE(
                                    "brand-shorter-name"
                                ),
                            },
                        ),
                    ),
                    FTL.Attribute(
                        id=FTL.Identifier("accesskey"),
                        value=COPY(
                            "browser/chrome/browser/baseMenuOverlay.dtd",
                            "aboutProduct2.accesskey",
                        ),
                    ),
                ],
            ),
        ],
    )
def migrate(ctx):
    """Bug 1445084 - Migrate search results pane of Preferences to Fluent, part {index}."""

    ctx.add_transforms(
        'browser/browser/preferences/preferences.ftl',
        'browser/browser/preferences/preferences.ftl', [
            FTL.Message(
                id=FTL.Identifier('search-input-box'),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('style'),
                        CONCAT(
                            FTL.TextElement('width: '),
                            COPY(
                                'browser/chrome/browser/preferences/preferences.dtd',
                                'searchField.width')),
                    ),
                    FTL.Attribute(
                        FTL.Identifier('placeholder'),
                        FTL.Pattern([
                            FTL.Placeable(
                                FTL.SelectExpression(
                                    expression=FTL.CallExpression(
                                        callee=FTL.Identifier('PLATFORM')),
                                    variants=[
                                        FTL.Variant(
                                            key=FTL.VariantName('windows'),
                                            default=False,
                                            value=COPY(
                                                'browser/chrome/browser/preferences/preferences.properties',
                                                'searchInput.labelWin')),
                                        FTL.Variant(
                                            key=FTL.VariantName('other'),
                                            default=True,
                                            value=COPY(
                                                'browser/chrome/browser/preferences/preferences.properties',
                                                'searchInput.labelUnix'))
                                    ]))
                        ])),
                ]),
            FTL.Message(
                id=FTL.Identifier('search-results-header'),
                value=COPY(
                    'browser/chrome/browser/preferences/preferences.dtd',
                    'paneSearchResults.title')),
            FTL.Message(
                id=FTL.Identifier('search-results-sorry-message'),
                value=FTL.Pattern(elements=[
                    FTL.Placeable(expression=FTL.SelectExpression(
                        expression=FTL.CallExpression(
                            callee=FTL.Identifier('PLATFORM')),
                        variants=[
                            FTL.Variant(
                                key=FTL.VariantName('windows'),
                                default=False,
                                value=REPLACE(
                                    'browser/chrome/browser/preferences/preferences.properties',
                                    'searchResults.sorryMessageWin',
                                    {'%S': FTL.TextElement("<span></span>")},
                                )),
                            FTL.Variant(
                                key=FTL.VariantName('other'),
                                default=True,
                                value=REPLACE(
                                    'browser/chrome/browser/preferences/preferences.properties',
                                    'searchResults.sorryMessageUnix',
                                    {'%S': FTL.TextElement("<span></span>")},
                                ))
                        ]))
                ]),
            ),
            FTL.Message(
                id=FTL.Identifier('search-results-need-help'),
                value=REPLACE(
                    'browser/chrome/browser/preferences/preferences.properties',
                    'searchResults.needHelp3',
                    {
                        '%S':
                        CONCAT(
                            FTL.TextElement('<a>'),
                            REPLACE(
                                'browser/chrome/browser/preferences/preferences.properties',
                                'searchResults.needHelpSupportLink',
                                {
                                    '%S':
                                    MESSAGE_REFERENCE('-brand-short-name'),
                                },
                            ),
                            FTL.TextElement('</a>'),
                        ),
                    },
                ),
            ),
        ])