Bug 1890689 Don't pretend to pre-buffer with DynamicResampler r=pehrsons
[gecko.git] / python / l10n / fluent_migrations / bug_1875957_web_appearance_warning.py
blobb07bcdf36ecfc85394d1451ccfd1efc83dc4175b
1 # Any copyright is dedicated to the Public Domain.
2 # http://creativecommons.org/publicdomain/zero/1.0/
4 import re
5 import fluent.syntax.ast as FTL
6 from fluent.migrate.transforms import TransformPattern
9 class STRIP_LINK(TransformPattern):
10 # Used to remove `<a data-l10n-name="colors-link">...</a>` from a string
11 def visit_TextElement(self, node):
12 node.value = re.sub(
13 '\s?<a data-l10n-name="colors-link">.+?</a>\s?',
14 "",
15 node.value,
17 return node
20 def migrate(ctx):
21 """Bug 1875957 - Use moz-message-bar for web appearance warning, part {index}"""
22 preferences_ftl = "browser/browser/preferences/preferences.ftl"
23 ctx.add_transforms(
24 preferences_ftl,
25 preferences_ftl,
27 FTL.Message(
28 id=FTL.Identifier("preferences-web-appearance-override-warning2"),
29 attributes=[
30 FTL.Attribute(
31 id=FTL.Identifier("message"),
32 value=STRIP_LINK(
33 preferences_ftl,
34 "preferences-web-appearance-override-warning",