Skip to content

Add Odia locale parity - #1779

Merged
clairernovotny merged 3 commits into
mainfrom
feat-or
May 16, 2026
Merged

Add Odia locale parity#1779
clairernovotny merged 3 commits into
mainfrom
feat-or

Conversation

@clairernovotny

Copy link
Copy Markdown
Member

Summary

  • Add Odia (or) locale data across formatter, number, ordinal, clock, compass, calendar, and parsing surfaces.
  • Add Odia locale-specific tests and parity matrix/theory coverage.

Validation

  • dotnet test tests/Humanizer.Tests/Humanizer.Tests.csproj --framework net10.0
  • dotnet test tests/Humanizer.SourceGenerators.Tests/Humanizer.SourceGenerators.Tests.csproj --framework net10.0
  • dotnet test tests/Humanizer.Tests/Humanizer.Tests.csproj --framework net8.0
  • dotnet test tests/Humanizer.Tests/Humanizer.Tests.csproj --framework net11.0
  • dotnet pack src/Humanizer/Humanizer.csproj -c Release -o artifacts/locale-parity-validation /m:1
  • dotnet format Humanizer.slnx --verify-no-changes --verbosity minimal

Copilot AI review requested due to automatic review settings May 16, 2026 19:49
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@coderabbitai

coderabbitai Bot commented May 16, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds 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.

Changes

Odia Localization

Layer / File(s) Summary
Odia locale YAML definition
src/Humanizer/Locales/or.yml
Defines the Odia locale: list conjunctions, relative-date and duration phrases, number-to-words with Indian grouping and gendered rules, parsing token maps, ordinal numeric/date rules, phrase-clock templates, compass directions, and calendar months.
Test data coverage
tests/Humanizer.Tests/Localisation/LocaleCoverageData.cs, LocaleFormatterExactTheoryData.cs, LocaleNumberMagnitudeTheoryData.cs, LocaleNumberOverloadTheoryData.cs, LocaleNumberTheoryData.cs, LocaleOrdinalizerMatrixData.cs, LocalePhraseTheoryData.cs
Extended numerous theory datasets with Odia expected values covering ordinal dates, clock notation, relative formatting, collections, cardinal/ordinal number-to-words (including genders and word forms), magnitudes, and time-span humanization.
Odia integration tests
tests/Humanizer.Tests/Localisation/or/OdiaLocaleTests.cs
New integration test class verifying list humanize, relative/null dates, duration humanization and to-words, data/time unit labels and symbols, number-to-words and parsing, ordinalization and parsing, exact ordinal date outputs (DateTime and DateOnly when available), clock notation (exact and rounded), and compass full/abbreviated directions.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 I hopped through YAML, nibbling each line,

Numbers and clocks now sound Odia-fine,
Tests clap their paws, words march in a row,
Months and compasses learn how to show,
A tiny rabbit cheers: локାଲ୍ ଆସିଲା — bravo!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Add Odia locale parity' directly and clearly summarizes the main change: adding Odia locale support to achieve parity with other locales.
Description check ✅ Passed The description is well-related to the changeset, providing a clear summary of what was added (Odia locale data across multiple surfaces), validation steps, and test coverage.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat-or

Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.yml with full surface configuration (relativeDate, duration, dataUnits, timeUnits, number words/parse, ordinal, clock, compass, calendar months).
  • Odia rows added to every shared Locale*TheoryData/LocaleCoverageData matrix to satisfy locale-matrix completeness tests.
  • New tests/Humanizer.Tests/Localisation/or/OdiaLocaleTests.cs exercising 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.

Comment thread src/Humanizer/Locales/or.yml Outdated
Comment thread src/Humanizer/Locales/or.yml
Comment thread src/Humanizer/Locales/or.yml Outdated
Comment thread src/Humanizer/Locales/or.yml Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 win

Fix critical duplicate key issue in cardinalMap (lines 407-523).

This YAML file contains multiple duplicate keys in the cardinalMap section. 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 in number.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

📥 Commits

Reviewing files that changed from the base of the PR and between 5519965 and e97e2c3.

📒 Files selected for processing (5)
  • src/Humanizer/Locales/or.yml
  • tests/Humanizer.Tests/Localisation/LocaleNumberMagnitudeTheoryData.cs
  • tests/Humanizer.Tests/Localisation/LocaleNumberTheoryData.cs
  • tests/Humanizer.Tests/Localisation/LocaleOrdinalizerMatrixData.cs
  • tests/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

Comment thread src/Humanizer/Locales/or.yml Outdated
Copilot AI review requested due to automatic review settings May 16, 2026 20:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Comment thread src/Humanizer/Locales/or.yml Outdated
Comment thread src/Humanizer/Locales/or.yml
Copilot AI review requested due to automatic review settings May 16, 2026 20:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Comment thread src/Humanizer/Locales/or.yml
Comment thread src/Humanizer/Locales/or.yml Outdated
Copilot AI review requested due to automatic review settings May 16, 2026 21:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated no new comments.

@clairernovotny
clairernovotny merged commit 26bef74 into main May 16, 2026
12 checks passed
@clairernovotny
clairernovotny deleted the feat-or branch May 16, 2026 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants