Skip to content

Commit ded2c12

Browse files
Merge pull request #643 from mozilla/philimon/l10n_amazon_de
Philimon/amazon_de_hotfix
2 parents 2f5fe3a + c8ab692 commit ded2c12

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

l10n_CM/constants/amazon/DE/amazon_ad.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
"name": "28f5f493-ad18-4e7c-99fa-524bc768ed7a",
66
"telephone": "c384d303-3e2b-4b8a-ba89-c741056fc9b4",
77
"street_address": "a5fb9e4c-60a0-42a2-9e4a-6a067b55d208",
8-
"organization": "9e8475b3-e1a5-46cf-9af0-6f2caab918fe",
98
"address_level_2": "67cbe0f8-dbe4-4afd-a077-765186bcf0b3",
109
"postal_code": "e38f3160-4ce5-4804-b5d5-b92c3ccc499e"
1110
},
@@ -15,7 +14,6 @@
1514
"28f5f493-ad18-4e7c-99fa-524bc768ed7a",
1615
"c384d303-3e2b-4b8a-ba89-c741056fc9b4",
1716
"a5fb9e4c-60a0-42a2-9e4a-6a067b55d208",
18-
"9e8475b3-e1a5-46cf-9af0-6f2caab918fe",
1917
"67cbe0f8-dbe4-4afd-a077-765186bcf0b3",
2018
"e38f3160-4ce5-4804-b5d5-b92c3ccc499e"
2119
]

modules/page_object_autofill.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,8 @@ def verify_form_data(self, sample_data: CreditCardBase | AutofillAddressBase):
245245
)
246246
elif attr_name == "expiration_date" and len(autofilled_field_value) > 5:
247247
autofilled_field_value = autofilled_field_value.replace("20", "")
248-
248+
elif attr_name == "country":
249+
expected_value = self.util.get_country_local_translation(expected_value)
249250
if autofilled_field_value.isdigit():
250251
# Handle expiration month comparison - normalize to integers to handle leading zeros
251252
autofilled_field_value = str(int(autofilled_field_value))

modules/util.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ def __init__(self):
103103
"Nunavut": "NU",
104104
"Yukon": "YT",
105105
}
106+
# temporary fix until faker issue is resolved
107+
self.country_local_translation = {"Germany": "Deutschland"}
106108
self.fake = None
107109
self.locale = None
108110

@@ -519,6 +521,15 @@ def get_state_province_abbreviation(self, full_name: str) -> str:
519521
"""
520522
return self.state_province_abbr.get(full_name, "Not Found")
521523

524+
def get_country_local_translation(self, country_name: str) -> str:
525+
"""
526+
Returns the local translation of the country name.
527+
528+
:param country_name: The full name of the country in english
529+
:return: The corresponding translation in the local language or the english name itself if not in the dictionary.
530+
"""
531+
return self.country_local_translation.get(country_name, country_name)
532+
522533
def normalize_regional_phone_numbers(self, phone: str, region: str) -> str:
523534
"""
524535
Normalizes a phone number by separating the country prefix and verifying the rest of the number as an integer.

0 commit comments

Comments
 (0)