From 6bf0a5cb5034a7e684dcc3500e841785237ce2dd Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 19:32:43 +0200 Subject: Adding upstream version 1:115.7.0. Signed-off-by: Daniel Baumann --- .../bug_1828340_aboutdialog_layout_fixes.py | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 comm/python/l10n/tb_fluent_migrations/completed/bug_1828340_aboutdialog_layout_fixes.py (limited to 'comm/python/l10n/tb_fluent_migrations/completed/bug_1828340_aboutdialog_layout_fixes.py') diff --git a/comm/python/l10n/tb_fluent_migrations/completed/bug_1828340_aboutdialog_layout_fixes.py b/comm/python/l10n/tb_fluent_migrations/completed/bug_1828340_aboutdialog_layout_fixes.py new file mode 100644 index 0000000000..d162e94659 --- /dev/null +++ b/comm/python/l10n/tb_fluent_migrations/completed/bug_1828340_aboutdialog_layout_fixes.py @@ -0,0 +1,42 @@ +# Any copyright is dedicated to the Public Domain. +# http://creativecommons.org/publicdomain/zero/1.0/ + +import re + +from fluent.migratetb import COPY_PATTERN +from fluent.migratetb.transforms import TransformPattern + +import fluent.syntax.ast as FTL + + +class STRIP_NEWLINES(TransformPattern): + def visit_TextElement(self, node): + node.value = re.sub("\n", "", node.value) + return node + + +def migrate(ctx): + """Bug 1828340 - Fix aboutDialog layout issues, part {index}.""" + path = "mail/messenger/aboutDialog.ftl" + ctx.add_transforms( + path, + path, + [ + FTL.Message( + id=FTL.Identifier("about-dialog-title"), + value=COPY_PATTERN(path, "aboutDialog-title.title"), + ), + FTL.Message( + id=FTL.Identifier("community-experimental"), + value=STRIP_NEWLINES(path, "community-exp"), + ), + FTL.Message( + id=FTL.Identifier("community-desc"), + value=STRIP_NEWLINES(path, "community-2"), + ), + FTL.Message( + id=FTL.Identifier("about-donation"), + value=STRIP_NEWLINES(path, "about-helpus"), + ), + ], + ) -- cgit v1.2.3