Skip to content

Commit f874b6e

Browse files
authored
Merge pull request #743 from mozilla/anca/add_at-region
Anca/ L10n - Add AT region
2 parents 039b1c6 + 81037cb commit f874b6e

File tree

5 files changed

+31
-3
lines changed

5 files changed

+31
-3
lines changed

l10n_CM/region/AT.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"region": "AT",
3+
"sites": [
4+
"demo",
5+
"torfs"
6+
],
7+
"tests": [
8+
]
9+
}

l10n_CM/run_l10n.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
current_dir = os.path.dirname(__file__)
1616
valid_flags = {"--run-headless", "-n", "--reruns", "--fx-executable", "--ci"}
1717
flag_with_parameter = {"-n", "--reruns"}
18-
valid_region = {"US", "CA", "DE", "FR", "IT", "GB", "PL", "ES", "BE"}
18+
valid_region = {"US", "CA", "DE", "FR", "IT", "GB", "PL", "ES", "BE", "AT"}
1919
valid_sites = {
2020
"aldoshoes",
2121
"amazon",

modules/browser_object_navigation.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,10 +269,11 @@ def open_tracker_panel(self) -> BasePage:
269269

270270
@BasePage.context_chrome
271271
def click_file_download_warning_panel(self) -> BasePage:
272-
""" exit file download warning panel if present """
272+
"""exit file download warning panel if present"""
273273
self.element_clickable("file-download-warning-button")
274274
self.click_on("file-download-warning-button")
275275
return self
276+
276277
def wait_for_item_to_download(self, filename: str) -> BasePage:
277278
"""
278279
Check the downloads tool in the toolbar to wait for a given file to download

modules/testrail_integration.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,9 @@ def reportable(platform_to_test=None):
202202
run_region in distributed_mappings[site]
203203
and platform in run_platform
204204
):
205-
logging.warning(f"Already reported: {site} {run_region},{run_platform}")
205+
logging.warning(
206+
f"Already reported: {site} {run_region},{run_platform}"
207+
)
206208
covered_mappings += 1
207209
logging.warning(
208210
f"Potentially matching run found for {platform}, may be reportable. (Found {covered_mappings} site/region mappings reported, expected {expected_mappings}.)"

modules/util.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ def __init__(self):
110110
"Spain": "España",
111111
"Poland": "Polska",
112112
"Belgium": "België",
113+
"Austria": "Österreich",
113114
}
114115

115116
self.fake = None
@@ -567,8 +568,23 @@ def normalize_regional_phone_numbers(self, phone: str, region: str) -> str:
567568
"PL": "48",
568569
"ES": "34",
569570
"BE": "32",
571+
"AT": "43",
570572
}
571573

574+
# If phone is already normalized, return as it is
575+
expected_country_code = country_codes.get(region)
576+
if (
577+
expected_country_code
578+
and phone.isdigit()
579+
and phone.startswith(expected_country_code)
580+
and len(phone) >= len(expected_country_code) + 6
581+
):
582+
return phone
583+
584+
# Fix Austrian duplicated country code before processing
585+
if region == "AT" and phone.startswith("+4343"):
586+
phone = "+43" + phone[5:] # Remove duplicated 43
587+
572588
# Sub out anything that matches this regex statement with an empty string to get rid of extensions in generated phone numbers
573589
phone = re.sub(r"\s*(?:x|ext)\s*\d*$", "", phone, flags=re.IGNORECASE)
574590
# Sub out anything that is not a digit with the empty string to ensure the phone number is formatted with no spaces or special characters

0 commit comments

Comments
 (0)