summaryrefslogtreecommitdiffstats
path: root/python/l10n/fluent_migrations/bug_1881582_autocomplete_merge.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/l10n/fluent_migrations/bug_1881582_autocomplete_merge.py')
-rw-r--r--python/l10n/fluent_migrations/bug_1881582_autocomplete_merge.py63
1 files changed, 63 insertions, 0 deletions
diff --git a/python/l10n/fluent_migrations/bug_1881582_autocomplete_merge.py b/python/l10n/fluent_migrations/bug_1881582_autocomplete_merge.py
new file mode 100644
index 0000000000..3a013cf82b
--- /dev/null
+++ b/python/l10n/fluent_migrations/bug_1881582_autocomplete_merge.py
@@ -0,0 +1,63 @@
+# 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 VARIABLE_REFERENCE
+from fluent.migrate.transforms import COPY, REPLACE
+
+
+def migrate(ctx):
+ """Bug 1881582 - Merge form autofill autocomplete items into normal autocomplete UI part {index}."""
+
+ propertiesSource = "browser/extensions/formautofill/formautofill.properties"
+ target = "toolkit/toolkit/formautofill/formAutofill.ftl"
+ ctx.add_transforms(
+ target,
+ target,
+ [
+ FTL.Message(
+ id=FTL.Identifier("autofill-clear-form-label"),
+ value=COPY(propertiesSource, "clearFormBtnLabel2"),
+ ),
+ FTL.Message(
+ id=FTL.Identifier("autofill-category-address"),
+ value=COPY(propertiesSource, "category.address"),
+ ),
+ FTL.Message(
+ id=FTL.Identifier("autofill-category-name"),
+ value=COPY(propertiesSource, "category.name"),
+ ),
+ FTL.Message(
+ id=FTL.Identifier("autofill-category-organization"),
+ value=COPY(propertiesSource, "category.organization2"),
+ ),
+ FTL.Message(
+ id=FTL.Identifier("autofill-category-tel"),
+ value=COPY(propertiesSource, "category.tel"),
+ ),
+ FTL.Message(
+ id=FTL.Identifier("autofill-category-email"),
+ value=COPY(propertiesSource, "category.email"),
+ ),
+ FTL.Message(
+ id=FTL.Identifier("autofill-phishing-warningmessage-extracategory"),
+ value=REPLACE(
+ propertiesSource,
+ "phishingWarningMessage",
+ {
+ "%1$S": VARIABLE_REFERENCE("categories"),
+ },
+ ),
+ ),
+ FTL.Message(
+ id=FTL.Identifier("autofill-phishing-warningmessage"),
+ value=REPLACE(
+ propertiesSource,
+ "phishingWarningMessage2",
+ {
+ "%1$S": VARIABLE_REFERENCE("categories"),
+ },
+ ),
+ ),
+ ],
+ )