summaryrefslogtreecommitdiffstats
path: root/python/l10n/fluent_migrations/bug_1812135_newtab_moz_toggle_labels.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/l10n/fluent_migrations/bug_1812135_newtab_moz_toggle_labels.py')
-rw-r--r--python/l10n/fluent_migrations/bug_1812135_newtab_moz_toggle_labels.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/python/l10n/fluent_migrations/bug_1812135_newtab_moz_toggle_labels.py b/python/l10n/fluent_migrations/bug_1812135_newtab_moz_toggle_labels.py
new file mode 100644
index 0000000000..27db47b0b5
--- /dev/null
+++ b/python/l10n/fluent_migrations/bug_1812135_newtab_moz_toggle_labels.py
@@ -0,0 +1,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,
+ ),
+ )