tor-browser

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

bug_1864038_screenshots_migration.py (1186B)


      1 # Any copyright is dedicated to the Public Domain.
      2 # http://creativecommons.org/publicdomain/zero/1.0/
      3 
      4 from fluent.migrate.helpers import transforms_from
      5 
      6 
      7 def migrate(ctx):
      8    """Bug 1864038 - Consolidate screenshots fluent files, part {index}."""
      9 
     10    source = "browser/browser/screenshotsOverlay.ftl"
     11    target = "browser/browser/screenshots.ftl"
     12 
     13    ctx.add_transforms(
     14        target,
     15        target,
     16        transforms_from(
     17            """
     18 screenshots-component-copy-button-label = {COPY_PATTERN(from_path, "screenshots-overlay-copy-button")}
     19 
     20 screenshots-component-download-button-label = {COPY_PATTERN(from_path, "screenshots-overlay-download-button")}
     21 
     22 screenshots-overlay-selection-region-size-2 = {COPY_PATTERN(from_path, "screenshots-overlay-selection-region-size")}
     23 """,
     24            from_path=source,
     25        ),
     26    )
     27 
     28    ctx.add_transforms(
     29        target,
     30        target,
     31        transforms_from(
     32            """
     33 screenshots-component-retry-button =
     34    .title = {COPY_PATTERN(from_path, "screenshots-retry-button-title.title")}
     35    .aria-label = {COPY_PATTERN(from_path, "screenshots-retry-button-title.title")}
     36 """,
     37            from_path=target,
     38        ),
     39    )