Skip to content

Commit

Permalink
fix: use default plural if there is no CLDR specific one
Browse files Browse the repository at this point in the history
  • Loading branch information
nijel committed Oct 22, 2024
1 parent 30543db commit d3bb664
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions weblate/lang/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -573,11 +573,11 @@ def setup(self, update, logger=lambda x: x) -> None: # noqa: C901
# Sync FORMULA_WITH_ZERO
for code, language_plurals in plurals.items():
if Plural.SOURCE_CLDR_ZERO in language_plurals:
if Plural.SOURCE_CLDR not in language_plurals:
logger(f"Missing CLDR plural for {code}!")
continue
if Plural.SOURCE_CLDR in language_plurals:
cldr_plural = language_plurals[Plural.SOURCE_CLDR][0]
else:
cldr_plural = language_plurals[Plural.SOURCE_DEFAULT][0]
zero_plural = language_plurals[Plural.SOURCE_CLDR_ZERO][0]
cldr_plural = language_plurals[Plural.SOURCE_CLDR][0]
current_formula = FORMULA_WITH_ZERO[cldr_plural.formula]
if zero_plural.formula != current_formula:
logger(f"Updating CLDR plural with zero for {code}")
Expand Down

0 comments on commit d3bb664

Please sign in to comment.