summaryrefslogtreecommitdiffstats
path: root/python/l10n/fluent_migrations/bug_1812135_newtab_moz_toggle_labels.py
blob: 27db47b0b5d4583ff81a60aaa9b522d8ee8669ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Any copyright is dedicated to the Public Domain.
# http://creativecommons.org/publicdomain/zero/1.0/

import fluent.syntax.ast as FTL
from fluent.migrate.helpers import transforms_from


def migrate(ctx):
    """Bug 1812135 - Convert some newtab customiation panel strings to use a label, part {index}"""

    translations_ftl = "browser/browser/newtab/newtab.ftl"

    ctx.add_transforms(
        translations_ftl,
        translations_ftl,
        transforms_from(
            """
newtab-custom-shortcuts-toggle =
  .label = {COPY_PATTERN(from_path, "newtab-custom-shortcuts-title")}
  .description = {COPY_PATTERN(from_path, "newtab-custom-shortcuts-subtitle")}
newtab-custom-pocket-toggle =
  .label = {COPY_PATTERN(from_path, "newtab-custom-pocket-title")}
  .description = {COPY_PATTERN(from_path, "newtab-custom-pocket-subtitle")}
newtab-custom-recent-toggle =
  .label = {COPY_PATTERN(from_path, "newtab-custom-recent-title")}
  .description = {COPY_PATTERN(from_path, "newtab-custom-recent-subtitle")}
""",
            from_path=translations_ftl,
        ),
    )