From 36d22d82aa202bb199967e9512281e9a53db42c9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 21:33:14 +0200 Subject: Adding upstream version 115.7.0esr. Signed-off-by: Daniel Baumann --- .../bug_1635548_browser_context.py | 82 ++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 python/l10n/fluent_migrations/bug_1635548_browser_context.py (limited to 'python/l10n/fluent_migrations/bug_1635548_browser_context.py') diff --git a/python/l10n/fluent_migrations/bug_1635548_browser_context.py b/python/l10n/fluent_migrations/bug_1635548_browser_context.py new file mode 100644 index 0000000000..33bd0efc95 --- /dev/null +++ b/python/l10n/fluent_migrations/bug_1635548_browser_context.py @@ -0,0 +1,82 @@ +# coding=utf8 + +# Any copyright is dedicated to the Public Domain. +# http://creativecommons.org/publicdomain/zero/1.0/ + +import fluent.syntax.ast as FTL +from fluent.migrate.helpers import transforms_from, VARIABLE_REFERENCE +from fluent.migrate import REPLACE, COPY + + +def migrate(ctx): + """Bug 1635548 - Migrate browser-context.inc to Fluent, part {index}""" + target = "toolkit/toolkit/global/textActions.ftl" + reference = "toolkit/toolkit/global/textActions.ftl" + ctx.add_transforms( + target, + reference, + transforms_from( + """ +text-action-spell-add-to-dictionary = + .label = { COPY(from_path, "spellAddToDictionary.label") } + .accesskey = { COPY(from_path, "spellAddToDictionary.accesskey") } + +text-action-spell-undo-add-to-dictionary = + .label = { COPY(from_path, "spellUndoAddToDictionary.label") } + .accesskey = { COPY(from_path, "spellUndoAddToDictionary.accesskey") } + +text-action-spell-check-toggle = + .label = { COPY(from_path, "spellCheckToggle.label") } + .accesskey = { COPY(from_path, "spellCheckToggle.accesskey") } + +text-action-spell-dictionaries = + .label = { COPY(from_path, "spellDictionaries.label") } + .accesskey = { COPY(from_path, "spellDictionaries.accesskey") } +""", + from_path="toolkit/chrome/global/textcontext.dtd", + ), + ) + + target = "toolkit/toolkit/global/textActions.ftl" + reference = "toolkit/toolkit/global/textActions.ftl" + ctx.add_transforms( + target, + reference, + transforms_from( + """ +text-action-spell-add-dictionaries = + .label = { COPY(from_path, "spellAddDictionaries.label") } + .accesskey = { COPY(from_path, "spellAddDictionaries.accesskey") } +""", + from_path="browser/chrome/browser/browser.dtd", + ), + ) + + target = "browser/browser/browserContext.ftl" + reference = "browser/browser/browserContext.ftl" + ctx.add_transforms( + target, + reference, + [ + FTL.Message( + id=FTL.Identifier("main-context-menu-open-link-in-container-tab"), + attributes=[ + FTL.Attribute( + FTL.Identifier("label"), + REPLACE( + "browser/chrome/browser/browser.properties", + "userContextOpenLink.label", + {"%1$S": VARIABLE_REFERENCE("containerName")}, + ), + ), + FTL.Attribute( + FTL.Identifier("accesskey"), + COPY( + "browser/chrome/browser/browser.dtd", + "openLinkCmdInTab.accesskey", + ), + ), + ], + ) + ], + ) -- cgit v1.2.3