From 26a029d407be480d791972afb5975cf62c9360a6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 02:47:55 +0200 Subject: Adding upstream version 124.0.1. Signed-off-by: Daniel Baumann --- .../bug_1814969_contextualIdentity.py | 101 +++++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 python/l10n/fluent_migrations/bug_1814969_contextualIdentity.py (limited to 'python/l10n/fluent_migrations/bug_1814969_contextualIdentity.py') diff --git a/python/l10n/fluent_migrations/bug_1814969_contextualIdentity.py b/python/l10n/fluent_migrations/bug_1814969_contextualIdentity.py new file mode 100644 index 0000000000..10a6bd5690 --- /dev/null +++ b/python/l10n/fluent_migrations/bug_1814969_contextualIdentity.py @@ -0,0 +1,101 @@ +# Any copyright is dedicated to the Public Domain. +# http://creativecommons.org/publicdomain/zero/1.0/ + +import fluent.syntax.ast as FTL +from fluent.migrate.transforms import COPY, COPY_PATTERN + + +def migrate(ctx): + """Bug 1814969 - Convert contextual identity service strings to Fluent, part {index}.""" + + source = "browser/chrome/browser/browser.properties" + alltabs = "browser/browser/allTabsMenu.ftl" + target = "toolkit/toolkit/global/contextual-identity.ftl" + ctx.add_transforms( + target, + target, + [ + FTL.Message( + id=FTL.Identifier("user-context-personal"), + attributes=[ + FTL.Attribute( + id=FTL.Identifier("label"), + value=COPY(source, "userContextPersonal.label"), + ), + FTL.Attribute( + id=FTL.Identifier("accesskey"), + value=COPY(source, "userContextPersonal.accesskey"), + ), + ], + ), + FTL.Message( + id=FTL.Identifier("user-context-work"), + attributes=[ + FTL.Attribute( + id=FTL.Identifier("label"), + value=COPY(source, "userContextWork.label"), + ), + FTL.Attribute( + id=FTL.Identifier("accesskey"), + value=COPY(source, "userContextWork.accesskey"), + ), + ], + ), + FTL.Message( + id=FTL.Identifier("user-context-banking"), + attributes=[ + FTL.Attribute( + id=FTL.Identifier("label"), + value=COPY(source, "userContextBanking.label"), + ), + FTL.Attribute( + id=FTL.Identifier("accesskey"), + value=COPY(source, "userContextBanking.accesskey"), + ), + ], + ), + FTL.Message( + id=FTL.Identifier("user-context-shopping"), + attributes=[ + FTL.Attribute( + id=FTL.Identifier("label"), + value=COPY(source, "userContextShopping.label"), + ), + FTL.Attribute( + id=FTL.Identifier("accesskey"), + value=COPY(source, "userContextShopping.accesskey"), + ), + ], + ), + FTL.Message( + id=FTL.Identifier("user-context-none"), + attributes=[ + FTL.Attribute( + id=FTL.Identifier("label"), + value=COPY(source, "userContextNone.label"), + ), + FTL.Attribute( + id=FTL.Identifier("accesskey"), + value=COPY(source, "userContextNone.accesskey"), + ), + ], + ), + FTL.Message( + id=FTL.Identifier("user-context-manage-containers"), + attributes=[ + FTL.Attribute( + id=FTL.Identifier("label"), + value=COPY_PATTERN( + alltabs, "all-tabs-menu-manage-user-context.label" + ), + ), + FTL.Attribute( + id=FTL.Identifier("accesskey"), + value=COPY_PATTERN( + alltabs, "all-tabs-menu-manage-user-context.accesskey" + ), + ), + ], + ), + ], + ) -- cgit v1.2.3