You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
TimeSpan.Humanize(toWords: true) returns English "one" for a single unit in 19 locales #2005
Two units and up are fine ("dua jam", "uch soat", "二 小时"). Affected locales: az, cs, el, hr, id, lv, ms, nl, pl, sk, sl, sr, sr-Latn, sv (6 units), th, uz-Cyrl-UZ, uz-Latn-UZ, zh-Hans, zh-Hant.
The cause is phrases.duration.<unit>.single.words, which still holds the English placeholder (words: 'one godzina'). I saw that #1879 kept the legacy toWords surfaces byte-identical on purpose, and CaseAwareCitationDoesNotChangeLegacyToWords pins "one gün" / "bir gün". So I want to ask before opening a PR: would you take a change to the legacy output?
For the 13 locales that author a citation phrase in durationCases, the legacy single.words value is set to that authored phrase (jedna godzina, bir kun, μία ώρα, ...). Legacy toWords and HumanizeWithCase(GrammaticalCase.Nominative) then return the same string, and the existing test becomes LegacyToWordsMatchesNominativeCitation.
id, ms, nl, th, zh-Hans and zh-Hant have no durationCases. For them the value is the locale's own 1.ToWords() plus the unit (satu jam, een uur, หนึ่ง ชั่วโมง, 一 小时). Multi-count output is already built the same way.
TimeSpanHumanizeCases gets a single-hour toWords row for each locale. LocaleRegistrySweepTests gets a check that no shipped non-English locale starts a single-unit toWords duration with "one". That check fails on 20 rows on current main.
Tests on net11.0: 61,683 passed. The 18 failures are the HijriCalendar_* tests, which fail the same way on a clean main on this Windows machine.
If you'd rather keep the legacy surface as is, the sweep test alone might still be worth having, with an allow-list. Either way works for me.
Activity