correct plural forms for week and millisecond in relative date phrases#1735
correct plural forms for week and millisecond in relative date phrases#1735sigmade wants to merge 2 commits intoHumanizr:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates Russian (ru) relative date phrase data so that week and millisecond use correct Russian grammatical-number forms (e.g., 2 недели, 2 миллисекунды) and adds regression coverage in the localisation phrase theory tests.
Changes:
- Extend
rurelative date phrase definitions forweekandmillisecondto use form maps (default/singular/dual) instead of a single plural form. - Add localisation theory test cases validating past/future phrasing for 1, 2, and 7 weeks/milliseconds in
ru.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tests/Humanizer.Tests/Localisation/LocalePhraseTheoryData.cs | Adds RU test cases for week/millisecond relative date phrases to verify corrected grammatical forms. |
| src/Humanizer/Locales/ru.yml | Updates RU relativeDate week and millisecond multiple.forms to support Russian singular/paucal/default selection. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
This PR adjusts Russian locale phrase data to use grammar-aware plural forms for relative date phrases so that counted expressions (e.g., “через 2 …”) use the correct Russian inflections.
Changes:
- Updated
ru.ymlrelative-date phrases forweekandmillisecondto providedefault/singular/dualforms instead of a single scalar form. - Updated the generated locale migration test to assert the presence of the Russian dual form for
weekin the phrase table.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| tests/Humanizer.Tests/Localisation/GeneratedLocaleData/GeneratedLocaleDeRuPhraseMigrationTests.cs | Updates expectations to validate the added Russian dual form for weeks in the phrase table. |
| src/Humanizer/Locales/ru.yml | Adds grammar-aware plural forms for Russian relative-date weeks/milliseconds (past & future). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -46,7 +46,7 @@ public void RussianPhraseTableUsesCompactGrammarAwareYamlForms() | |||
|
|
|||
| Assert.True(table.TryGetDatePhrase(TimeUnit.Week, Tense.Future, out var futureWeek)); | |||
| multiple: | ||
| forms: 'миллисекунд' | ||
| forms: | ||
| default: 'миллисекунд' | ||
| singular: 'миллисекунду' | ||
| dual: 'миллисекунды' | ||
| afterCount: 'назад' |
Here is a checklist you should tick through before submitting a pull request:
mainbranch (more info below)fixes #<the issue number>build.cmdorbuild.ps1and ensure there are no test failures