tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

bug_1971433_preferences.py (1114B)


      1 # Any copyright is dedicated to the Public Domain.
      2 # http://creativecommons.org/publicdomain/zero/1.0/
      3 
      4 import fluent.syntax.ast as FTL
      5 from fluent.migrate import COPY_PATTERN
      6 from fluent.migrate.transforms import COPY
      7 from fluent.migrate.helpers import transforms_from
      8 
      9 
     10 def migrate(ctx):
     11    """Bug 1971433 - Convert Certificates section to config-based prefs - part {index}"""
     12 
     13    # part 1, migrate a legacy string
     14    source = "security/manager/chrome/pippki/pippki.properties"
     15    target = "browser/browser/preferences/preferences.ftl"
     16    ctx.add_transforms(
     17        target,
     18        target,
     19        [
     20            FTL.Message(
     21                id=FTL.Identifier("certs-devices-enable-fips"),
     22                value=COPY(source, "enable_fips"),
     23            )
     24        ],
     25    )
     26 
     27    # part 2, restructure existing strings
     28    ctx.add_transforms(
     29        target,
     30        target,
     31        transforms_from(
     32            """
     33 certs-description2 =
     34    .label = {COPY_PATTERN(from_path, "certs-header")}
     35    .description = {COPY_PATTERN(from_path, "certs-description")}
     36 """,
     37            from_path=target,
     38        ),
     39    )