def migrate(ctx):
    """Bug 1453800 - Migrate Container removal strings to Fluent, part {index}."""

    ctx.add_transforms(
        'browser/browser/preferences/preferences.ftl',
        'browser/browser/preferences/preferences.ftl',
        [
            FTL.Message(
                id=FTL.Identifier('containers-remove-alert-title'),
                value=COPY(
                    'browser/chrome/browser/preferences/preferences.properties',
                    'removeContainerAlertTitle',
                ),
            ),
            FTL.Message(
                id=FTL.Identifier('containers-remove-alert-msg'),
                value=PLURALS(
                    'browser/chrome/browser/preferences/preferences.properties',
                    'removeContainerMsg',
                    EXTERNAL_ARGUMENT('count'),
                    lambda text: REPLACE_IN_TEXT(
                        text,
                        {
                            '#S': EXTERNAL_ARGUMENT('count')
                        }
                    )
                )
            ),
            FTL.Message(
                id=FTL.Identifier('containers-remove-ok-button'),
                value=COPY(
                    'browser/chrome/browser/preferences/preferences.properties',
                    'removeContainerOkButton',
                ),
            ),
            FTL.Message(
                id=FTL.Identifier('containers-remove-cancel-button'),
                value=COPY(
                    'browser/chrome/browser/preferences/preferences.properties',
                    'removeContainerButton2',
                ),
            ),
        ]
    )
def migrate(ctx):
    """Bug 1419547 - Migrate Preferences::Containers to Fluent, part {index}."""

    ctx.add_transforms(
        'browser/browser/preferences/preferences.ftl',
        'browser/browser/preferences/preferences.ftl', [
            FTL.Message(
                id=FTL.Identifier('containers-back-link'),
                value=COPY('browser/chrome/browser/preferences/containers.dtd',
                           'backLink2.label')),
            FTL.Message(
                id=FTL.Identifier('containers-header'),
                value=COPY(
                    'browser/chrome/browser/preferences/preferences.dtd',
                    'paneContainers.title',
                )),
            FTL.Message(
                id=FTL.Identifier('containers-add-button'),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('label'),
                        COPY(
                            'browser/chrome/browser/preferences/containers.dtd',
                            'addButton.label')),
                    FTL.Attribute(
                        FTL.Identifier('accesskey'),
                        COPY(
                            'browser/chrome/browser/preferences/containers.dtd',
                            'addButton.accesskey')),
                ]),
            FTL.Message(
                id=FTL.Identifier('containers-preferences-button'),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('label'),
                        COPY(
                            'browser/chrome/browser/preferences/containers.dtd',
                            'preferencesButton.label')),
                ]),
            FTL.Message(
                id=FTL.Identifier('containers-remove-button'),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('label'),
                        COPY(
                            'browser/chrome/browser/preferences/containers.dtd',
                            'removeButton.label')),
                ]),
        ])

    ctx.add_transforms('browser/browser/preferences/containers.ftl', 'browser/browser/preferences/containers.ftl', [
        FTL.
        Message(
            id=FTL.Identifier('containers-window-new'),
            attributes=[
                FTL.
                Attribute(
                    FTL.
                    Identifier('title'),
                    COPY(
                        'browser/chrome/browser/preferences/containers.dtd',
                        'window.title',
                    ),
                ),
                FTL.
                Attribute(
                    FTL.
                    Identifier('style'),
                    CONCAT(
                        FTL.
                        TextElement('width: '),
                        COPY(
                            'browser/chrome/browser/preferences/containers.dtd',
                            'window.width',
                        ),
                    ),
                ),
            ],
        ),
        FTL.
        Message(
            id=FTL.Identifier('containers-window-update'),
            attributes=[
                FTL.
                Attribute(
                    FTL.
                    Identifier('title'),
                    REPLACE(
                        'browser/chrome/browser/preferences/containers.properties',
                        'containers.updateContainerTitle',
                        {'%S': EXTERNAL_ARGUMENT('name')},
                    ),
                ),
                FTL.
                Attribute(
                    FTL.
                    Identifier('style'),
                    COPY(
                        'browser/chrome/browser/preferences/containers.dtd',
                        'window.width',
                    ),
                ),
            ],
        ),
        FTL.
        Message(
            id=FTL.Identifier('containers-window-close'),
            attributes=[
                FTL.
                Attribute(
                    FTL
                    .Identifier('key'),
                    COPY(
                        'browser/chrome/browser/preferences/containers.dtd',
                        'windowClose.key',
                    ),
                ),
            ],
        ),
        FTL.
        Term(
            id=FTL.Identifier('-containers-labels-style'),
            value=CONCAT(
                FTL.
                TextElement('min-width: '),
                COPY(
                    'browser/chrome/browser/preferences/containers.properties',
                    'containers.labelMinWidth',
                ),
            ),
        ),
        FTL.
        Message(
            id=FTL.Identifier('containers-name-label'),
            value=COPY(
                'browser/chrome/browser/preferences/containers.dtd',
                'name2.label',
            ),
            attributes=[
                FTL.
                Attribute(
                    FTL.
                    Identifier('accesskey'),
                    COPY(
                        'browser/chrome/browser/preferences/containers.dtd',
                        'name2.accesskey',
                    ),
                ),
                FTL.
                Attribute(
                    FTL.
                    Identifier('style'),
                    CONCAT(MESSAGE_REFERENCE('-containers-labels-style'), )),
            ],
        ),
        FTL.
        Message(
            id=FTL.Identifier('containers-name-text'),
            attributes=[
                FTL.
                Attribute(
                    FTL.
                    Identifier('placeholder'),
                    COPY(
                        'browser/chrome/browser/preferences/containers.dtd',
                        'name.placeholder',
                    ),
                ),
            ],
        ),
        FTL.
        Message(
            id=FTL.Identifier('containers-icon-label'),
            value=COPY(
                'browser/chrome/browser/preferences/containers.dtd',
                'icon2.label',
            ),
            attributes=[
                FTL.
                Attribute(
                    FTL.
                    Identifier('accesskey'),
                    COPY(
                        'browser/chrome/browser/preferences/containers.dtd',
                        'icon2.accesskey',
                    ),
                ),
                FTL.
                Attribute(
                    FTL.
                    Identifier('style'),
                    CONCAT(MESSAGE_REFERENCE('-containers-labels-style'), )),
            ],
        ),
        FTL.
        Message(
            id=FTL.Identifier('containers-color-label'),
            value=COPY(
                'browser/chrome/browser/preferences/containers.dtd',
                'color2.label',
            ),
            attributes=[
                FTL.
                Attribute(
                    FTL.
                    Identifier('accesskey'),
                    COPY(
                        'browser/chrome/browser/preferences/containers.dtd',
                        'color2.accesskey',
                    ),
                ),
                FTL.
                Attribute(
                    FTL.
                    Identifier('style'),
                    CONCAT(MESSAGE_REFERENCE('-containers-labels-style'), )),
            ],
        ),
        FTL.
        Message(
            id=FTL.Identifier('containers-button-done'),
            attributes=[
                FTL.
                Attribute(
                    FTL.
                    Identifier('label'),
                    COPY(
                        'browser/chrome/browser/preferences/containers.dtd',
                        'button.ok.label',
                    ),
                ),
                FTL.
                Attribute(
                    FTL.
                    Identifier('accesskey'),
                    COPY(
                        'browser/chrome/browser/preferences/containers.dtd',
                        'button.ok.accesskey',
                    ),
                ),
            ],
        ),
        FTL.
        Message(
            id=FTL.Identifier('containers-remove-alert-title'),
            value=COPY(
                'browser/chrome/browser/preferences/preferences.properties',
                'removeContainerAlertTitle',
            ),
        ),
        FTL.
        Message(
            id=FTL.Identifier('containers-remove-alert-msg'),
            value=PLURALS(
                'browser/chrome/browser/preferences/preferences.properties',
                'removeContainerMsg', EXTERNAL_ARGUMENT('count'), lambda text:
                REPLACE_IN_TEXT(text, {'#S': EXTERNAL_ARGUMENT('count')}))
        ),
        FTL.
        Message(
            id=FTL.Identifier('containers-remove-ok-button'),
            value=COPY(
                'browser/chrome/browser/preferences/preferences.properties',
                'removeContainerOkButton',
            ),
        ),
        FTL.
        Message(
            id=FTL.Identifier('containers-remove-cancel-button'),
            value=COPY(
                'browser/chrome/browser/preferences/preferences.properties',
                'removeContainerButton2',
            ),
        ),
        FTL.
        Message(
            id=FTL.Identifier('containers-color-blue'),
            attributes=[
                FTL.
                Attribute(
                    FTL.
                    Identifier('label'),
                    COPY(
                        'browser/chrome/browser/preferences/containers.properties',
                        'containers.blue.label',
                    ),
                ),
            ],
        ),
        FTL.
        Message(
            id=FTL.Identifier('containers-color-turquoise'),
            attributes=[
                FTL.
                Attribute(
                    FTL.
                    Identifier('label'),
                    COPY(
                        'browser/chrome/browser/preferences/containers.properties',
                        'containers.turquoise.label',
                    ),
                ),
            ],
        ),
        FTL.
        Message(
            id=FTL.Identifier('containers-color-green'),
            attributes=[
                FTL.
                Attribute(
                    FTL.
                    Identifier('label'),
                    COPY(
                        'browser/chrome/browser/preferences/containers.properties',
                        'containers.green.label',
                    ),
                ),
            ],
        ),
        FTL.
        Message(
            id=FTL.Identifier('containers-color-yellow'),
            attributes=[
                FTL.
                Attribute(
                    FTL.
                    Identifier('label'),
                    COPY(
                        'browser/chrome/browser/preferences/containers.properties',
                        'containers.yellow.label',
                    ),
                ),
            ],
        ),
        FTL.
        Message(
            id=FTL.Identifier('containers-color-orange'),
            attributes=[
                FTL.
                Attribute(
                    FTL.
                    Identifier('label'),
                    COPY(
                        'browser/chrome/browser/preferences/containers.properties',
                        'containers.orange.label',
                    ),
                ),
            ],
        ),
        FTL.
        Message(
            id=FTL.Identifier('containers-color-red'),
            attributes=[
                FTL.
                Attribute(
                    FTL.
                    Identifier('label'),
                    COPY(
                        'browser/chrome/browser/preferences/containers.properties',
                        'containers.red.label',
                    ),
                ),
            ],
        ),
        FTL.
        Message(
            id=FTL.Identifier('containers-color-pink'),
            attributes=[
                FTL.
                Attribute(
                    FTL.
                    Identifier('label'),
                    COPY(
                        'browser/chrome/browser/preferences/containers.properties',
                        'containers.pink.label',
                    ),
                ),
            ],
        ),
        FTL.
        Message(
            id=FTL.Identifier('containers-color-purple'),
            attributes=[
                FTL.
                Attribute(
                    FTL.
                    Identifier('label'),
                    COPY(
                        'browser/chrome/browser/preferences/containers.properties',
                        'containers.purple.label',
                    ),
                ),
            ],
        ),
        FTL.
        Message(
            id=FTL.Identifier('containers-icon-fingerprint'),
            attributes=[
                FTL.
                Attribute(
                    FTL.
                    Identifier('label'),
                    COPY(
                        'browser/chrome/browser/preferences/containers.properties',
                        'containers.fingerprint.label',
                    ),
                ),
            ],
        ),
        FTL.
        Message(
            id=FTL.Identifier('containers-icon-briefcase'),
            attributes=[
                FTL.
                Attribute(
                    FTL.
                    Identifier('label'),
                    COPY(
                        'browser/chrome/browser/preferences/containers.properties',
                        'containers.briefcase.label',
                    ),
                ),
            ],
        ),
        FTL.
        Message(
            id=FTL.Identifier('containers-icon-dollar'),
            attributes=[
                FTL.
                Attribute(
                    FTL.
                    Identifier('label'),
                    COPY(
                        'browser/chrome/browser/preferences/containers.properties',
                        'containers.dollar.label',
                    ),
                ),
            ],
        ),
        FTL.
        Message(
            id=FTL.Identifier('containers-icon-cart'),
            attributes=[
                FTL.
                Attribute(
                    FTL.
                    Identifier('label'),
                    COPY(
                        'browser/chrome/browser/preferences/containers.properties',
                        'containers.cart.label',
                    ),
                ),
            ],
        ),
        FTL.
        Message(
            id=FTL.Identifier('containers-icon-circle'),
            attributes=[
                FTL.
                Attribute(
                    FTL.
                    Identifier('label'),
                    COPY(
                        'browser/chrome/browser/preferences/containers.properties',
                        'containers.circle.label',
                    ),
                ),
            ],
        ),
        FTL.
        Message(
            id=FTL.Identifier('containers-icon-vacation'),
            attributes=[
                FTL.
                Attribute(
                    FTL.
                    Identifier('label'),
                    COPY(
                        'browser/chrome/browser/preferences/containers.properties',
                        'containers.vacation.label',
                    ),
                ),
            ],
        ),
        FTL.
        Message(
            id=FTL.Identifier('containers-icon-gift'),
            attributes=[
                FTL.
                Attribute(
                    FTL.
                    Identifier('label'),
                    COPY(
                        'browser/chrome/browser/preferences/containers.properties',
                        'containers.gift.label',
                    ),
                ),
            ],
        ),
        FTL.
        Message(
            id=FTL.Identifier('containers-icon-food'),
            attributes=[
                FTL.
                Attribute(
                    FTL.
                    Identifier('label'),
                    COPY(
                        'browser/chrome/browser/preferences/containers.properties',
                        'containers.food.label',
                    ),
                ),
            ],
        ),
        FTL.Message(
            id=FTL.Identifier('containers-icon-fruit'),
            attributes=[
                FTL.Attribute(
                    FTL.Identifier('label'),
                    COPY(
                        'browser/chrome/browser/preferences/containers.properties',
                        'containers.fruit.label',
                    ),
                ),
            ],
        ),
        FTL.Message(
            id=FTL.Identifier('containers-icon-pet'),
            attributes=[
                FTL.Attribute(
                    FTL.Identifier('label'),
                    COPY(
                        'browser/chrome/browser/preferences/containers.properties',
                        'containers.pet.label',
                    ),
                ),
            ],
        ),
        FTL.Message(
            id=FTL.Identifier('containers-icon-tree'),
            attributes=[
                FTL.Attribute(
                    FTL.Identifier('label'),
                    COPY(
                        'browser/chrome/browser/preferences/containers.properties',
                        'containers.tree.label',
                    ),
                ),
            ],
        ),
        FTL.Message(
            id=FTL.Identifier('containers-icon-chill'),
            attributes=[
                FTL.Attribute(
                    FTL.Identifier('label'),
                    COPY(
                        'browser/chrome/browser/preferences/containers.properties',
                        'containers.chill.label',
                    ),
                ),
            ],
        ),
    ])
def migrate(ctx):
    """Bug 1438375 - Migrate Extension Controlled settings in Preferences to Fluent, part {index}."""

    ctx.add_transforms(
        'browser/browser/preferences/preferences.ftl',
        'browser/browser/preferences/preferences.ftl', [
            FTL.Message(
                id=FTL.Identifier('extension-controlled-homepage-override'),
                value=REPLACE(
                    'browser/chrome/browser/preferences/preferences.properties',
                    'extensionControlled.homepage_override2', {
                        '%S':
                        CONCAT(
                            FTL.TextElement('<img data-l10n-name="icon"/> '),
                            EXTERNAL_ARGUMENT('name'))
                    })),
            FTL.Message(
                id=FTL.Identifier('extension-controlled-new-tab-url'),
                value=REPLACE(
                    'browser/chrome/browser/preferences/preferences.properties',
                    'extensionControlled.newTabURL2', {
                        '%S':
                        CONCAT(
                            FTL.TextElement('<img data-l10n-name="icon"/> '),
                            EXTERNAL_ARGUMENT('name'))
                    })),
            FTL.Message(
                id=FTL.Identifier('extension-controlled-default-search'),
                value=REPLACE(
                    'browser/chrome/browser/preferences/preferences.properties',
                    'extensionControlled.defaultSearch', {
                        '%S':
                        CONCAT(
                            FTL.TextElement('<img data-l10n-name="icon"/> '),
                            EXTERNAL_ARGUMENT('name'))
                    })),
            FTL.Message(
                id=FTL.Identifier('extension-controlled-privacy-containers'),
                value=REPLACE(
                    'browser/chrome/browser/preferences/preferences.properties',
                    'extensionControlled.privacy.containers', {
                        '%S':
                        CONCAT(
                            FTL.TextElement('<img data-l10n-name="icon"/> '),
                            EXTERNAL_ARGUMENT('name'))
                    })),
            FTL.Message(
                id=FTL.Identifier(
                    'extension-controlled-websites-tracking-protection-mode'),
                value=REPLACE(
                    'browser/chrome/browser/preferences/preferences.properties',
                    'extensionControlled.websites.trackingProtectionMode', {
                        '%S':
                        CONCAT(
                            FTL.TextElement('<img data-l10n-name="icon"/> '),
                            EXTERNAL_ARGUMENT('name'))
                    })),
            FTL.Message(
                id=FTL.Identifier('extension-controlled-proxy-config'),
                value=REPLACE(
                    'browser/chrome/browser/preferences/preferences.properties',
                    'extensionControlled.proxyConfig', {
                        '%1$S':
                        CONCAT(
                            FTL.TextElement('<img data-l10n-name="icon"/> '),
                            EXTERNAL_ARGUMENT('name')),
                        '%2$S':
                        MESSAGE_REFERENCE('-brand-short-name'),
                    })),
            FTL.Message(
                id=FTL.Identifier('extension-controlled-enable'),
                value=REPLACE(
                    'browser/chrome/browser/preferences/preferences.properties',
                    'extensionControlled.enable', {
                        '%1$S':
                        FTL.TextElement('<img data-l10n-name="addons-icon"/>'),
                        '%2$S':
                        FTL.TextElement('<img data-l10n-name="menu-icon"/>'),
                    })),
            FTL.Message(
                id=FTL.Identifier('network-proxy-connection-description'),
                value=REPLACE(
                    'browser/chrome/browser/preferences/preferences.properties',
                    'connectionDesc.label', {
                        '%S': MESSAGE_REFERENCE('-brand-short-name'),
                    })),
        ])
def migrate(ctx):
    """Migrate about:dialog, part {index}"""

    ctx.add_transforms('browser/about_dialog.ftl', 'about_dialog.ftl', [
        FTL.Message(
            id=FTL.Identifier('update-failed'),
            value=CONCAT(
                COPY(
                    'browser/chrome/browser/aboutDialog.dtd',
                    'update.failed.start'
                ),
                FTL.TextElement('<a>'),
                COPY(
                    'browser/chrome/browser/aboutDialog.dtd',
                    'update.failed.linkText'
                ),
                FTL.TextElement('</a>'),
                COPY(
                    'browser/chrome/browser/aboutDialog.dtd',
                    'update.failed.end'
                )
            )
        ),
        FTL.Message(
            id=FTL.Identifier('channel-description'),
            value=CONCAT(
                COPY(
                    'browser/chrome/browser/aboutDialog.dtd',
                    'channel.description.start'
                ),
                FTL.Placeable(EXTERNAL_ARGUMENT('channelname')),
                COPY(
                    'browser/chrome/browser/aboutDialog.dtd',
                    'channel.description.end'
                )
            )
        ),
        FTL.Message(
            id=FTL.Identifier('community'),
            value=CONCAT(
                REPLACE(
                    'browser/chrome/browser/aboutDialog.dtd',
                    'community.start2',
                    {
                        '&brandShortName;': MESSAGE_REFERENCE(
                            'brand-short-name'
                        )
                    }
                ),
                FTL.TextElement('<a>'),
                REPLACE(
                    'browser/chrome/browser/aboutDialog.dtd',
                    'community.mozillaLink',
                    {
                        '&vendorShortName;': MESSAGE_REFERENCE(
                            'vendor-short-name'
                        )
                    }
                ),
                FTL.TextElement('</a>'),
                COPY(
                    'browser/chrome/browser/aboutDialog.dtd',
                    'community.middle2'
                ),
                FTL.TextElement('<a>'),
                COPY(
                    'browser/chrome/browser/aboutDialog.dtd',
                    'community.creditsLink'
                ),
                FTL.TextElement('</a>'),
                COPY(
                    'browser/chrome/browser/aboutDialog.dtd',
                    'community.end3'
                )
            )
        ),
    ])
Exemplo n.º 5
0
def migrate(ctx):
    """Bug 1415733 - Migrate the "Search" section of Preferences to the new Localization API, part {index}"""

    ctx.add_transforms(
        'browser/browser/preferences/preferences.ftl',
        'browser/browser/preferences/preferences.ftl', [
            FTL.Message(id=FTL.Identifier('search-bar-header'),
                        value=COPY(
                            'browser/chrome/browser/preferences/search.dtd',
                            'searchBar.label')),
            FTL.Message(
                id=FTL.Identifier('search-bar-hidden'),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('label'),
                        COPY('browser/chrome/browser/preferences/search.dtd',
                             'searchBar.hidden.label'))
                ]),
            FTL.Message(
                id=FTL.Identifier('search-bar-shown'),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('label'),
                        COPY('browser/chrome/browser/preferences/search.dtd',
                             'searchBar.shown.label'))
                ]),
            FTL.Message(id=FTL.Identifier('search-engine-default-header'),
                        value=COPY(
                            'browser/chrome/browser/preferences/search.dtd',
                            'defaultSearchEngine.label')),
            FTL.Message(id=FTL.Identifier('search-engine-default-desc'),
                        value=COPY(
                            'browser/chrome/browser/preferences/search.dtd',
                            'chooseYourDefaultSearchEngine2.label')),
            FTL.Message(
                id=FTL.Identifier('search-suggestions-option'),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('label'),
                        COPY('browser/chrome/browser/preferences/search.dtd',
                             'provideSearchSuggestions.label')),
                    FTL.Attribute(
                        FTL.Identifier('accesskey'),
                        COPY('browser/chrome/browser/preferences/search.dtd',
                             'provideSearchSuggestions.accesskey'))
                ]),
            FTL.Message(
                id=FTL.Identifier('search-show-suggestions-url-bar-option'),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('label'),
                        COPY('browser/chrome/browser/preferences/search.dtd',
                             'showURLBarSuggestions2.label')),
                    FTL.Attribute(
                        FTL.Identifier('accesskey'),
                        COPY('browser/chrome/browser/preferences/search.dtd',
                             'showURLBarSuggestions2.accesskey'))
                ]),
            FTL.Message(
                id=FTL.Identifier(
                    'search-show-suggestions-above-history-option'),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('label'),
                        COPY('browser/chrome/browser/preferences/search.dtd',
                             'showSearchSuggestionsAboveHistory.label')),
                ]),
            FTL.Message(
                id=FTL.Identifier('search-suggestions-cant-show'),
                value=REPLACE('browser/chrome/browser/preferences/search.dtd',
                              'urlBarSuggestionsPermanentPB.label', {
                                  '&brandShortName;':
                                  MESSAGE_REFERENCE('-brand-short-name')
                              }),
            ),
            FTL.Message(id=FTL.Identifier('search-one-click-header'),
                        value=COPY(
                            'browser/chrome/browser/preferences/search.dtd',
                            'oneClickSearchEngines.label')),
            FTL.Message(id=FTL.Identifier('search-one-click-desc'),
                        value=COPY(
                            'browser/chrome/browser/preferences/search.dtd',
                            'chooseWhichOneToDisplay2.label')),
            FTL.Message(
                id=FTL.Identifier('search-choose-engine-column'),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('label'),
                        COPY('browser/chrome/browser/preferences/search.dtd',
                             'engineNameColumn.label')),
                ]),
            FTL.Message(
                id=FTL.Identifier('search-choose-keyword-column'),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('label'),
                        COPY('browser/chrome/browser/preferences/search.dtd',
                             'engineKeywordColumn.label')),
                ]),
            FTL.Message(
                id=FTL.Identifier('search-restore-default'),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('label'),
                        COPY('browser/chrome/browser/preferences/search.dtd',
                             'restoreDefaultSearchEngines.label')),
                    FTL.Attribute(
                        FTL.Identifier('accesskey'),
                        COPY('browser/chrome/browser/preferences/search.dtd',
                             'restoreDefaultSearchEngines.accesskey'))
                ]),
            FTL.Message(
                id=FTL.Identifier('search-remove-engine'),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('label'),
                        COPY('browser/chrome/browser/preferences/search.dtd',
                             'removeEngine.label')),
                    FTL.Attribute(
                        FTL.Identifier('accesskey'),
                        COPY('browser/chrome/browser/preferences/search.dtd',
                             'removeEngine.accesskey'))
                ]),
            FTL.Message(id=FTL.Identifier('search-find-more-link'),
                        value=COPY(
                            'browser/chrome/browser/preferences/search.dtd',
                            'findMoreSearchEngines.label')),
            FTL.Message(id=FTL.Identifier('search-keyword-warning-title'),
                        value=COPY(
                            'browser/chrome/browser/engineManager.properties',
                            'duplicateTitle')),
            FTL.Message(
                id=FTL.Identifier('search-keyword-warning-engine'),
                value=REPLACE(
                    'browser/chrome/browser/engineManager.properties',
                    'duplicateEngineMsg', {'%S': EXTERNAL_ARGUMENT('name')}),
            ),
            FTL.Message(id=FTL.Identifier('search-keyword-warning-bookmark'),
                        value=COPY(
                            'browser/chrome/browser/engineManager.properties',
                            'duplicateBookmarkMsg')),
        ])
Exemplo n.º 6
0
def migrate(ctx):
    """Bug 1442542 - Migrate Preferences::Subdialogs::ClearSiteData properties strings to Fluent, part {index}."""

    ctx.add_transforms(
        'browser/browser/preferences/clearSiteData.ftl',
        'browser/browser/preferences/clearSiteData.ftl', [
            FTL.Message(
                id=FTL.Identifier('clear-site-data-cookies-with-data'),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('label'),
                        REPLACE(
                            'browser/chrome/browser/preferences/clearSiteData.properties',
                            'clearSiteDataWithEstimates.label', {
                                '%1$S': EXTERNAL_ARGUMENT('amount'),
                                '%2$S': EXTERNAL_ARGUMENT('unit')
                            })),
                    FTL.Attribute(
                        FTL.Identifier('accesskey'),
                        COPY(
                            'browser/chrome/browser/preferences/clearSiteData.dtd',
                            'clearSiteData.accesskey'))
                ]),
            FTL.Message(
                id=FTL.Identifier('clear-site-data-cookies-empty'),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('label'),
                        COPY(
                            'browser/chrome/browser/preferences/clearSiteData.dtd',
                            'clearSiteData.label')),
                    FTL.Attribute(
                        FTL.Identifier('accesskey'),
                        COPY(
                            'browser/chrome/browser/preferences/clearSiteData.dtd',
                            'clearSiteData.accesskey'))
                ]),
            FTL.Message(
                id=FTL.Identifier('clear-site-data-cache-with-data'),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('label'),
                        REPLACE(
                            'browser/chrome/browser/preferences/clearSiteData.properties',
                            'clearCacheWithEstimates.label', {
                                '%1$S': EXTERNAL_ARGUMENT('amount'),
                                '%2$S': EXTERNAL_ARGUMENT('unit')
                            })),
                    FTL.Attribute(
                        FTL.Identifier('accesskey'),
                        COPY(
                            'browser/chrome/browser/preferences/clearSiteData.dtd',
                            'clearCache.accesskey'))
                ]),
            FTL.Message(
                id=FTL.Identifier('clear-site-data-cache-empty'),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('label'),
                        COPY(
                            'browser/chrome/browser/preferences/clearSiteData.dtd',
                            'clearCache.label')),
                    FTL.Attribute(
                        FTL.Identifier('accesskey'),
                        COPY(
                            'browser/chrome/browser/preferences/clearSiteData.dtd',
                            'clearCache.accesskey'))
                ])
        ])
def migrate(ctx):
    """Migrate about:download in Firefox for Android, part {index}"""

    ctx.add_transforms('mobile/about_downloads.ftl', 'about_downloads.ftl', [
        FTL.Message(id=FTL.Identifier('title'),
                    value=COPY('mobile/android/chrome/aboutDownloads.dtd',
                               'aboutDownloads.title')),
        FTL.Message(id=FTL.Identifier('header'),
                    value=COPY('mobile/android/chrome/aboutDownloads.dtd',
                               'aboutDownloads.header')),
        FTL.Message(id=FTL.Identifier('empty'),
                    value=COPY('mobile/android/chrome/aboutDownloads.dtd',
                               'aboutDownloads.empty')),
        FTL.Message(id=FTL.Identifier('open-menuitem'),
                    attributes=[
                        FTL.Attribute(
                            FTL.Identifier('label'),
                            COPY('mobile/android/chrome/aboutDownloads.dtd',
                                 'aboutDownloads.open'))
                    ]),
        FTL.Message(id=FTL.Identifier('retry-menuitem'),
                    attributes=[
                        FTL.Attribute(
                            FTL.Identifier('label'),
                            COPY('mobile/android/chrome/aboutDownloads.dtd',
                                 'aboutDownloads.retry'))
                    ]),
        FTL.Message(id=FTL.Identifier('remove-menuitem'),
                    attributes=[
                        FTL.Attribute(
                            FTL.Identifier('label'),
                            COPY('mobile/android/chrome/aboutDownloads.dtd',
                                 'aboutDownloads.remove'))
                    ]),
        FTL.Message(id=FTL.Identifier('pause-menuitem'),
                    attributes=[
                        FTL.Attribute(
                            FTL.Identifier('label'),
                            COPY('mobile/android/chrome/aboutDownloads.dtd',
                                 'aboutDownloads.pause'))
                    ]),
        FTL.Message(id=FTL.Identifier('resume-menuitem'),
                    attributes=[
                        FTL.Attribute(
                            FTL.Identifier('label'),
                            COPY('mobile/android/chrome/aboutDownloads.dtd',
                                 'aboutDownloads.resume'))
                    ]),
        FTL.Message(id=FTL.Identifier('cancel-menuitem'),
                    attributes=[
                        FTL.Attribute(
                            FTL.Identifier('label'),
                            COPY('mobile/android/chrome/aboutDownloads.dtd',
                                 'aboutDownloads.cancel'))
                    ]),
        FTL.Message(id=FTL.Identifier('remove-all-menuitem'),
                    attributes=[
                        FTL.Attribute(
                            FTL.Identifier('label'),
                            COPY('mobile/android/chrome/aboutDownloads.dtd',
                                 'aboutDownloads.removeAll'))
                    ]),
        FTL.Message(id=FTL.Identifier('delete-all-title'),
                    value=COPY(
                        'mobile/android/chrome/aboutDownloads.properties',
                        'downloadAction.deleteAll')),
        FTL.Message(id=FTL.Identifier('delete-all-message'),
                    value=PLURALS(
                        'mobile/android/chrome/aboutDownloads.properties',
                        'downloadMessage.deleteAll',
                        EXTERNAL_ARGUMENT('num'), lambda text: REPLACE_IN_TEXT(
                            text, {'#1': EXTERNAL_ARGUMENT('num')}))),
        FTL.Message(id=FTL.Identifier('download-state-downloading'),
                    value=COPY(
                        'mobile/android/chrome/aboutDownloads.properties',
                        'downloadState.downloading')),
        FTL.Message(id=FTL.Identifier('download-state-canceled'),
                    value=COPY(
                        'mobile/android/chrome/aboutDownloads.properties',
                        'downloadState.canceled')),
        FTL.Message(id=FTL.Identifier('download-state-failed'),
                    value=COPY(
                        'mobile/android/chrome/aboutDownloads.properties',
                        'downloadState.failed')),
        FTL.Message(id=FTL.Identifier('download-state-paused'),
                    value=COPY(
                        'mobile/android/chrome/aboutDownloads.properties',
                        'downloadState.paused')),
        FTL.Message(id=FTL.Identifier('download-state-starting'),
                    value=COPY(
                        'mobile/android/chrome/aboutDownloads.properties',
                        'downloadState.starting')),
        FTL.Message(id=FTL.Identifier('download-size-unknown'),
                    value=COPY(
                        'mobile/android/chrome/aboutDownloads.properties',
                        'downloadState.unknownSize')),
    ])
Exemplo n.º 8
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',
                ),
            ),
        ]
    )
Exemplo n.º 9
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>'))),
        ])
def migrate(ctx):
    """Bug 1451992 - Migrate Preferences::Subdialogs::ApplicationManager to Fluent, part {index}."""

    ctx.add_transforms(
        'browser/browser/preferences/applicationManager.ftl',
        'browser/browser/preferences/applicationManager.ftl',
        [
            FTL.Message(
                id=FTL.Identifier('app-manager-window'),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('title'),
                        COPY(
                            'browser/chrome/browser/preferences/applicationManager.dtd',
                            'appManager.title',
                        ),
                    ),
                    FTL.Attribute(
                        FTL.Identifier('style'),
                        COPY(
                            'browser/chrome/browser/preferences/applicationManager.dtd',
                            'appManager.style',
                        ),
                    ),
                ],
            ),
            FTL.Message(
                id=FTL.Identifier('app-manager-remove'),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('label'),
                        COPY(
                            'browser/chrome/browser/preferences/applicationManager.dtd',
                            'remove.label',
                        ),
                    ),
                    FTL.Attribute(
                        FTL.Identifier('accesskey'),
                        COPY(
                            'browser/chrome/browser/preferences/applicationManager.dtd',
                            'remove.accesskey',
                        ),
                    ),
                ],
            ),
            FTL.Message(
                id=FTL.Identifier('app-manager-handle-webfeeds'),
                value=REPLACE(
                    'browser/chrome/browser/preferences/applicationManager.properties',
                    'descriptionApplications',
                    {
                        '%S': COPY(
                            'browser/chrome/browser/preferences/applicationManager.properties',
                            'handleWebFeeds',
                        )
                    }
                ),
            ),
            FTL.Message(
                id=FTL.Identifier('app-manager-handle-protocol'),
                value=REPLACE(
                    'browser/chrome/browser/preferences/applicationManager.properties',
                    'descriptionApplications',
                    {
                        '%S': REPLACE(
                            'browser/chrome/browser/preferences/applicationManager.properties',
                            'handleProtocol',
                            {
                                '%S': EXTERNAL_ARGUMENT('type')
                            }
                        )
                    }
                ),
            ),
            FTL.Message(
                id=FTL.Identifier('app-manager-handle-file'),
                value=REPLACE(
                    'browser/chrome/browser/preferences/applicationManager.properties',
                    'descriptionApplications',
                    {
                        '%S': REPLACE(
                            'browser/chrome/browser/preferences/applicationManager.properties',
                            'handleFile',
                            {
                                '%S': EXTERNAL_ARGUMENT('type')
                            }
                        )
                    }
                ),
            ),
            FTL.Message(
                id=FTL.Identifier('app-manager-web-app-info'),
                value=COPY(
                    'browser/chrome/browser/preferences/applicationManager.properties',
                    'descriptionWebApp',
                ),
            ),
            FTL.Message(
                id=FTL.Identifier('app-manager-local-app-info'),
                value=COPY(
                    'browser/chrome/browser/preferences/applicationManager.properties',
                    'descriptionLocalApp',
                ),
            ),
        ]
    )
Exemplo n.º 11
0
def migrate(ctx):
    """Bug 1457021 - Migrate the JS of Preferences subdialogs to Fluent, part {index}."""

    ctx.add_transforms(
        'browser/browser/preferences/permissions.ftl',
        'browser/browser/preferences/permissions.ftl',
        transforms_from(
"""
permissions-capabilities-allow =
    .label = { COPY("browser/chrome/browser/preferences/preferences.properties", "can") }
permissions-capabilities-block =
    .label = { COPY("browser/chrome/browser/preferences/preferences.properties", "cannot") }
permissions-capabilities-prompt =
    .label = { COPY("browser/chrome/browser/preferences/preferences.properties", "prompt") }
""")
    )

    ctx.add_transforms(
        'browser/browser/preferences/blocklists.ftl',
        'browser/browser/preferences/blocklists.ftl',
        transforms_from(
"""
blocklist-item-moz-std-name = { COPY("browser/chrome/browser/preferences/preferences.properties", "mozstdName") }
blocklist-item-moz-std-desc = { COPY("browser/chrome/browser/preferences/preferences.properties", "mozstdDesc") }
blocklist-item-moz-full-name = { COPY("browser/chrome/browser/preferences/preferences.properties", "mozfullName") }
blocklist-item-moz-full-desc = { COPY("browser/chrome/browser/preferences/preferences.properties", "mozfullDesc2") }
""") + [
            FTL.Message(
                id=FTL.Identifier('blocklist-item-list-template'),
                value=REPLACE(
                    'browser/chrome/browser/preferences/preferences.properties',
                    'mozNameTemplate',
                    {
                        '%1$S': EXTERNAL_ARGUMENT(
                            'listName'
                        ),
                        '%2$S': EXTERNAL_ARGUMENT(
                            'description'
                        )
                    }
                )
            )
        ]
    )

    ctx.add_transforms(
        'browser/browser/preferences/fonts.ftl',
        'browser/browser/preferences/fonts.ftl',
        transforms_from(
"""
fonts-very-large-warning-title = { COPY("browser/chrome/browser/preferences/preferences.properties", "veryLargeMinimumFontTitle") }
fonts-very-large-warning-message = { COPY("browser/chrome/browser/preferences/preferences.properties", "veryLargeMinimumFontWarning") }
fonts-very-large-warning-accept = { COPY("browser/chrome/browser/preferences/preferences.properties", "acceptVeryLargeMinimumFont") }
fonts-label-default-unnamed =
    .label = { COPY("browser/chrome/browser/preferences/preferences.properties", "labelDefaultFontUnnamed") }
""") + [
            FTL.Message(
                id=FTL.Identifier('fonts-label-default'),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('label'),
                        REPLACE(
                            'browser/chrome/browser/preferences/preferences.properties',
                            'labelDefaultFont',
                            {
                                '%S': EXTERNAL_ARGUMENT(
                                    'name'
                                )
                            }
                        )
                    ),
                ]
            )
        ]
    )

    ctx.add_transforms(
        'browser/browser/preferences/preferences.ftl',
        'browser/browser/preferences/preferences.ftl',
        transforms_from(
"""
sitedata-total-size-calculating = { COPY("browser/chrome/browser/preferences/preferences.properties", "loadingSiteDataSize1") }
""") + [
            FTL.Message(
                id=FTL.Identifier('sitedata-total-size'),
                value=REPLACE(
                    'browser/chrome/browser/preferences/preferences.properties',
                    'totalSiteDataSize2',
                    {
                        '%1$S': EXTERNAL_ARGUMENT(
                            'value'
                        ),
                        '%2$S': EXTERNAL_ARGUMENT(
                            'unit'
                        )
                    }
                )
            )
        ]
    )

    ctx.add_transforms(
        'browser/browser/preferences/siteDataSettings.ftl',
        'browser/browser/preferences/siteDataSettings.ftl',
        transforms_from(
"""
site-data-remove-all =
    .label = { COPY("browser/chrome/browser/preferences/preferences.properties", "removeAllSiteData.label") }
    .accesskey = { COPY("browser/chrome/browser/preferences/preferences.properties", "removeAllSiteData.accesskey") }
site-data-remove-shown =
    .label = { COPY("browser/chrome/browser/preferences/preferences.properties", "removeAllSiteDataShown.label") }
    .accesskey = { COPY("browser/chrome/browser/preferences/preferences.properties", "removeAllSiteDataShown.accesskey") }
site-data-removing-dialog =
    .title = { site-data-removing-header }
    .buttonlabelaccept = { COPY("browser/chrome/browser/preferences/preferences.properties", "acceptRemove") }

""") + [
            # This replacement might not always work, since locales can either
            # remove the space, or use a non-breaking space for "%1$S %2$S"
            FTL.Message(
                id=FTL.Identifier('site-usage-persistent'),
                value=REPLACE(
                    'browser/chrome/browser/preferences/preferences.properties',
                    'siteUsagePersistent',
                    {
                        '%1$S %2$S': MESSAGE_REFERENCE(
                            'site-usage-pattern'
                        )
                    }
                )
            ),
            FTL.Message(
                id=FTL.Identifier('site-data-settings-description'),
                value=REPLACE(
                    'browser/chrome/browser/preferences/preferences.properties',
                    'siteDataSettings3.description',
                    {
                        '%S': MESSAGE_REFERENCE(
                            '-brand-short-name'
                        )
                    }
                )
            ),
            FTL.Message(
                id=FTL.Identifier('site-usage-pattern'),
                value=REPLACE(
                    'browser/chrome/browser/preferences/preferences.properties',
                    'siteUsage',
                    {
                        '%1$S': EXTERNAL_ARGUMENT(
                            'value'
                        ),
                        '%2$S': EXTERNAL_ARGUMENT(
                            'unit'
                        )
                    }
                )
            )
        ]
    )

    ctx.add_transforms(
        'browser/browser/preferences/languages.ftl',
        'browser/browser/preferences/languages.ftl',
        [
            FTL.Message(
                id=FTL.Identifier('languages-code-format'),
                attributes=[
                    FTL.Attribute(
                        FTL.Identifier('label'),
                        REPLACE(
                            'browser/chrome/browser/preferences/preferences.properties',
                            'languageCodeFormat',
                            {
                                '%1$S': EXTERNAL_ARGUMENT(
                                    'locale'
                                ),
                                '%2$S': EXTERNAL_ARGUMENT(
                                    'code'
                                )
                            }
                        )
                    )
                ]
            )
        ]
    )