From d4c2c31eb3d1896bf5419439576e8243990b6904 Mon Sep 17 00:00:00 2001 From: Bart Feenstra Date: Fri, 5 Dec 2025 20:07:24 +0000 Subject: [PATCH] Declare the major CLDR version used --- babel/localedata.py | 2 ++ scripts/download_import_cldr.py | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/babel/localedata.py b/babel/localedata.py index ac67c2fb0..372edc8ff 100644 --- a/babel/localedata.py +++ b/babel/localedata.py @@ -30,6 +30,8 @@ _windows_reserved_name_re = re.compile("^(con|prn|aux|nul|com[0-9]|lpt[0-9])$", re.I) +CLDR_MAJOR_VERSION=47 + def normalize_locale(name: str) -> str | None: """Normalize a locale ID by stripping spaces and apply proper casing. diff --git a/scripts/download_import_cldr.py b/scripts/download_import_cldr.py index 85308aec8..3b9985c4d 100755 --- a/scripts/download_import_cldr.py +++ b/scripts/download_import_cldr.py @@ -9,8 +9,10 @@ import zipfile from urllib.request import urlretrieve -URL = 'https://unicode.org/Public/cldr/47/cldr-common-47.zip' -FILENAME = 'cldr-common-47.0.zip' +from babel.localedata import CLDR_MAJOR_VERSION + +URL = f'https://unicode.org/Public/cldr/{CLDR_MAJOR_VERSION}/cldr-common-{CLDR_MAJOR_VERSION}.zip' +FILENAME = f'cldr-common-{CLDR_MAJOR_VERSION}.0.zip' # Via https://unicode.org/Public/cldr/45/hashes/SHASUM512.txt FILESUM = '3b1eb2a046dae23cf16f611f452833e2a95affb1aa2ae3fa599753d229d152577114c2ff44ca98a7f369fa41dc6f45b0d7a6647653ca79694aacfd3f3be59801' BLKSIZE = 131072