Skip to content

Commit 0185c56

Browse files
committed
feat: gracefully handle additional plural data in CLDR
1 parent 43ef274 commit 0185c56

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

scripts/export-cldr.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,9 @@ class LanguageDict(TypedDict, total=False):
246246
data = json.load(handle)
247247
for cldr_code, categories in data["supplemental"]["plurals-type-cardinal"].items():
248248
code = map_code(cldr_code)
249+
# Copy language data from basic
250+
if code not in LANGUAGES and "_" in code:
251+
LANGUAGES[code] = LANGUAGES[code.split("_", 1)[0]]
249252
if len(categories) == 1:
250253
# Just one category
251254
LANGUAGES[code]["plurals"] = 1

0 commit comments

Comments
 (0)