fix: use singular Lithuanian form for counts like 101 and 201#237
Merged
Conversation
Owner
|
Thanks! This has been published in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Lithuanian plural helper picks the wrong form for counts whose last two digits are "01" (101, 201, 301, and so on). It returns the genitive plural instead of the singular, so a 101 ms duration renders as "101 milisekundžių" instead of "101 milisekundė".
getLithuanianFormdetected the singular ("one") form with:The
c % 100 > 20guard is there to exclude 11 (where Lithuanian uses the plural), but it also excludesc % 100 === 1(101, 201, ...), which should be singular. The Latvian helper right below it already uses the correct idiom:That also matches the CLDR Lithuanian rule, where
oneisi % 10 = 1 and i % 100 != 11..19; for the integer counts handled here that reduces toi % 10 === 1 && i % 100 !== 11. So 1, 21, 31, ..., 101, 121 are singular and 11, 111, 211 stay plural.This reuses that idiom for Lithuanian. The counts that were already correct (1, 21 through 91, and 11..19) are unchanged; only 101, 201, ..., 901 move from the plural to the singular form.
Also added two rows to
test/definitions/lt.tsv(101 -> singular, 211 -> still plural) and aHISTORY.mdentry.