Add Odia locale parity - #1779
Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds Odia (or) locale YAML, extends many Locale*TheoryData test datasets with Odia expected values, and adds an integration test suite verifying Odia localization across numbers, dates, durations, clocks, and compass directions. ChangesOdia Localization
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Pull request overview
Adds the Odia (or) locale to Humanizer, providing date/time, duration, number-to-words, ordinal, clock, compass, calendar, list-conjunction, and words-to-number coverage, plus parity entries across the shared locale theory matrices and a dedicated Odia test suite.
Changes:
- New
src/Humanizer/Locales/or.ymlwith full surface configuration (relativeDate, duration, dataUnits, timeUnits, number words/parse, ordinal, clock, compass, calendar months). - Odia rows added to every shared
Locale*TheoryData/LocaleCoverageDatamatrix to satisfy locale-matrix completeness tests. - New
tests/Humanizer.Tests/Localisation/or/OdiaLocaleTests.csexercising list, relative date, duration, data unit, time unit, number-to-words, words-to-number, ordinalize, date/dateOnly, clock, and compass surfaces.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Humanizer/Locales/or.yml | New Odia locale definition driving all humanization surfaces. |
| tests/Humanizer.Tests/Localisation/or/OdiaLocaleTests.cs | Dedicated Odia behavioural tests. |
| tests/Humanizer.Tests/Localisation/LocaleCoverageData.cs | Adds or rows to coverage matrix (dates, clock, lists, ordinals, cardinals). |
| tests/Humanizer.Tests/Localisation/LocaleFormatterExactTheoryData.cs | Adds Odia formatter expectations (relative dates, durations, units, lists, headings). |
| tests/Humanizer.Tests/Localisation/LocaleNumberTheoryData.cs | Adds Odia cardinal/ordinal/negative number expectations and parse rows. |
| tests/Humanizer.Tests/Localisation/LocaleNumberOverloadTheoryData.cs | Adds Odia million-scale expectations for overload variants. |
| tests/Humanizer.Tests/Localisation/LocaleNumberMagnitudeTheoryData.cs | Adds Odia magnitude (lakh/crore) expectations. |
| tests/Humanizer.Tests/Localisation/LocaleOrdinalizerMatrixData.cs | Adds Odia rows to ordinalizer matrix across genders and word forms. |
| tests/Humanizer.Tests/Localisation/LocalePhraseTheoryData.cs | Adds Odia rows to relative-date/never/duration phrase matrices. |
Comments suppressed due to low confidence (2)
src/Humanizer/Locales/or.yml:340
- The denseUnitsMap entry for 94 is
'ଚଉରାଁଲବେ', which contains aଲ(la) where every neighbouring 90s entry usesନ(na): 91ଏକାନବେ, 92ବୟାନବେ, 93ତେୟାନବେ, 95ପଞ୍ଚାନବେ, 96ଛୟାନବେ. This looks like a typo forଚଉରାନବେ. The same misspelling is mirrored in cardinalMap (line 510), so parsing/formatting will round-trip, but the rendered word for 94 will still be wrong for users. Worth confirming with an Odia speaker.
- 'ଚଉରାଁଲବେ'
src/Humanizer/Locales/or.yml:314
- denseUnitsMap[68] is
'ଅଟଷଟି'(withଷଟ), whereas the surrounding 60s entries all useଷଠ: 62ବାଷଠି, 63ତେଷଠି, 64ଚଉଷଠି, 66ଛଅଷଠି, 67ସତଷଠୀ. The expected Odia word for 68 isଅଠଷଠି(withଠ, notଟ, and starting withଅଠrather thanଅଟ). This appears to be a typo. cardinalMap (line 484) repeats the same string, so input/output round-trips, but the formatted word for 68 will display incorrectly.
- 'ଅଟଷଟି'
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/Humanizer/Locales/or.yml (1)
1-667:⚠️ Potential issue | 🔴 Critical | ⚡ Quick winFix critical duplicate key issue in
cardinalMap(lines 407-523).This YAML file contains multiple duplicate keys in the
cardinalMapsection. In YAML, duplicate keys cause the last value to override earlier values, resulting in data loss. The following keys are duplicated:
0: appears as 'ଶୂନ୍ୟ', 'ଶୁନ', 'ଶୂନ'20: appears as 'କୋଡ଼ିଏ', 'କୋଡିଏ'30: appears as 'ତିରିଶ', 'ତିରିଶି'40: appears as 'ଚାଳିଶ', 'ଚାଳିଶି'60: appears as 'ଷାଠିଏ', 'ଷାଠି'80: appears as 'ଅଶୀ' (listed twice)- Plus larger numbers like
100,1000, etc.The alternate spellings (lines 508-523) cannot coexist as separate keys in a YAML map. Consider using a different structure for alternate spellings, such as a list under each numeric key, or handle them separately in the parser logic.
Additionally, the indentation in
ordinal.numeric.masculine.exactReplacements(lines 557–576) uses 10 spaces instead of the 8 spaces used innumber.words.ordinal.masculine.exactReplacements(lines 354–373), inconsistent with the comment on line 551 requiring synchronization.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/Humanizer/Locales/or.yml` around lines 1 - 667, The cardinalMap contains duplicate numeric keys (e.g., variants for 0, 20, 30, 40, 60, 80, 100, 1000, etc.) which YAML merges and causes data loss; update the cardinalMap so each numeric value appears once and include alternate spellings as a list of aliases (or move them into a new synonyms/aliases structure) rather than repeating numeric keys—modify the cardinalMap block to consolidate duplicates into a single entry per number with an array of variant strings, and update any consuming parser logic if necessary to read aliases; also fix indentation for ordinal.numeric.masculine.exactReplacements to match number.words.ordinal.masculine.exactReplacements (make the spacing consistent) so the two exactReplacements blocks remain in sync.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/Humanizer/Locales/or.yml`:
- Line 514: Remove the duplicate 'ଅଶୀ': 80 entry from the cardinalMap mapping
(the key 'ଅଶୀ' is already defined earlier) — either delete this duplicate line
or replace it with the correct alternate Odia word for 80 if an alternate
spelling was intended; ensure only one mapping for the 80 value remains in
cardinalMap.
---
Outside diff comments:
In `@src/Humanizer/Locales/or.yml`:
- Around line 1-667: The cardinalMap contains duplicate numeric keys (e.g.,
variants for 0, 20, 30, 40, 60, 80, 100, 1000, etc.) which YAML merges and
causes data loss; update the cardinalMap so each numeric value appears once and
include alternate spellings as a list of aliases (or move them into a new
synonyms/aliases structure) rather than repeating numeric keys—modify the
cardinalMap block to consolidate duplicates into a single entry per number with
an array of variant strings, and update any consuming parser logic if necessary
to read aliases; also fix indentation for
ordinal.numeric.masculine.exactReplacements to match
number.words.ordinal.masculine.exactReplacements (make the spacing consistent)
so the two exactReplacements blocks remain in sync.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: a5192bbb-aefc-4926-85d0-387751874c43
📒 Files selected for processing (5)
src/Humanizer/Locales/or.ymltests/Humanizer.Tests/Localisation/LocaleNumberMagnitudeTheoryData.cstests/Humanizer.Tests/Localisation/LocaleNumberTheoryData.cstests/Humanizer.Tests/Localisation/LocaleOrdinalizerMatrixData.cstests/Humanizer.Tests/Localisation/or/OdiaLocaleTests.cs
✅ Files skipped from review due to trivial changes (1)
- tests/Humanizer.Tests/Localisation/LocaleNumberTheoryData.cs
🚧 Files skipped from review as they are similar to previous changes (2)
- tests/Humanizer.Tests/Localisation/LocaleNumberMagnitudeTheoryData.cs
- tests/Humanizer.Tests/Localisation/or/OdiaLocaleTests.cs
Summary
or) locale data across formatter, number, ordinal, clock, compass, calendar, and parsing surfaces.Validation
dotnet test tests/Humanizer.Tests/Humanizer.Tests.csproj --framework net10.0dotnet test tests/Humanizer.SourceGenerators.Tests/Humanizer.SourceGenerators.Tests.csproj --framework net10.0dotnet test tests/Humanizer.Tests/Humanizer.Tests.csproj --framework net8.0dotnet test tests/Humanizer.Tests/Humanizer.Tests.csproj --framework net11.0dotnet pack src/Humanizer/Humanizer.csproj -c Release -o artifacts/locale-parity-validation /m:1dotnet format Humanizer.slnx --verify-no-changes --verbosity minimal