Skip to content

Add Kannada locale parity#1749

Merged
clairernovotny merged 8 commits into
mainfrom
feat-kn
May 14, 2026
Merged

Add Kannada locale parity#1749
clairernovotny merged 8 commits into
mainfrom
feat-kn

Conversation

@clairernovotny

Copy link
Copy Markdown
Member

Summary

  • Add Kannada (kn) generated locale data across canonical Humanizer surfaces.
  • Add exact-output Kannada localization tests and shared locale matrix rows.
  • Update Supported Languages documentation for Kannada (kn).

Notes

  • Kannada number words are aligned with Unicode CLDR Kannada RBNF for hundreds, scale connectors, negatives, and ordinal word forms.
  • No shared generator/runtime/schema contracts were changed.

Validation

  • dotnet test tests/Humanizer.Tests/Humanizer.Tests.csproj --framework net10.0 -- --filter-namespace Humanizer.Tests.Localisation.kn
  • dotnet test tests/Humanizer.Tests/Humanizer.Tests.csproj --framework net10.0 -- --filter-class Humanizer.Tests.Localisation.LocaleTheoryMatrixCompletenessTests --stop-on-fail off
  • dotnet test tests/Humanizer.SourceGenerators.Tests/Humanizer.SourceGenerators.Tests.csproj --framework net11.0
  • dotnet test tests/Humanizer.Tests/Humanizer.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 tests/Humanizer.Tests/Humanizer.Tests.csproj --verify-no-changes --verbosity minimal --no-restore
  • git diff --check

Caveats

  • tests/Humanizer.SourceGenerators.Tests currently targets net11.0, so the requested --framework net10.0 variant is not a valid TFM for that project in this checkout.
  • Initial non--m:1 pack and solution-level format attempts hit MSBuild child-node crashes; single-node pack and scoped format validation succeeded.

Copilot AI review requested due to automatic review settings May 14, 2026 00:58
@coderabbitai

coderabbitai Bot commented May 14, 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 Kannada (kn) localization: updates supported-languages docs, extends many existing localisation TheoryData datasets with Kannada expected rows, and adds two Kannada-focused test suites for numbers and non-number surface formatting.

Changes

Kannada Localization Support

Layer / File(s) Summary
Documentation update
docs/localization.md
Supported language list is updated to include/reflow the Kannada locale enumeration.
Test data additions
tests/Humanizer.Tests/Localisation/LocaleCoverageData.cs, tests/Humanizer.Tests/Localisation/LocaleFormatterExactTheoryData.cs, tests/Humanizer.Tests/Localisation/LocaleNumberMagnitudeTheoryData.cs, tests/Humanizer.Tests/Localisation/LocaleNumberOverloadTheoryData.cs, tests/Humanizer.Tests/Localisation/LocaleNumberTheoryData.cs, tests/Humanizer.Tests/Localisation/LocaleOrdinalizerMatrixData.cs, tests/Humanizer.Tests/Localisation/LocalePhraseTheoryData.cs
Added Kannada (kn) expected-string rows across date ordinals, time/clock formats, collection humanization, cardinal/ordinal numbers, magnitude/overload cases, ordinalizer matrices, and phrase/time-span cases.
Kannada-specific test suites
tests/Humanizer.Tests/Localisation/kn/KannadaNonNumberSurfaceTests.cs, tests/Humanizer.Tests/Localisation/kn/KannadaNumberToWordsTests.cs
New xUnit tests validate Kannada number-to-words, ordinal words, words-to-number parsing/round-trips (including long.MinValue), and non-number localization surfaces (conjunctions, relative dates, durations, clock notation, headings, byte sizes).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • Humanizr/Humanizer#1742: Updates similar localization theory datasets for a different locale (am), adding expected rows rather than runtime changes.
  • Humanizr/Humanizer#1752: Modifies the same locale test-vector files by adding expected rows for another locale (my).
  • Humanizr/Humanizer#1748: Adds expected rows for another locale in the same localization test datasets.

Suggested labels

localisation

Poem

🐰 I hopped through tests and docs today,
Placed "kn" in rows where phrases play,
Numbers, times, and headings sing,
Little assertions make them spring,
A tiny hop for language day.

🚥 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 Kannada locale parity' directly and clearly describes the main change: adding Kannada locale support to achieve parity across Humanizer surfaces.
Description check ✅ Passed The description comprehensively explains the changes (Kannada locale data, tests, documentation updates), alignment with CLDR standards, and includes detailed validation steps and caveats.
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-kn

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

@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

🤖 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 `@tests/Humanizer.Tests/Localisation/kn/KannadaNumberToWordsTests.cs`:
- Line 29: The test contains contiguous 13-digit numeric literals (e.g.,
4325010007018) that trigger PAN scanners; update the InlineData attributes in
KannadaNumberToWordsTests (the InlineData entries on the failing lines) to use
C# digit separators (underscores) to represent the same numeric value (for
example 4_325_010_007_018) so the literal is unchanged but not contiguous; apply
the same change to both occurrences referenced in the comment.
🪄 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: ac4c7798-b836-4699-9915-6d7fbfeae814

📥 Commits

Reviewing files that changed from the base of the PR and between c25ff8a and bdb6417.

📒 Files selected for processing (11)
  • docs/localization.md
  • src/Humanizer/Locales/kn.yml
  • tests/Humanizer.Tests/Localisation/LocaleCoverageData.cs
  • tests/Humanizer.Tests/Localisation/LocaleFormatterExactTheoryData.cs
  • tests/Humanizer.Tests/Localisation/LocaleNumberMagnitudeTheoryData.cs
  • tests/Humanizer.Tests/Localisation/LocaleNumberOverloadTheoryData.cs
  • tests/Humanizer.Tests/Localisation/LocaleNumberTheoryData.cs
  • tests/Humanizer.Tests/Localisation/LocaleOrdinalizerMatrixData.cs
  • tests/Humanizer.Tests/Localisation/LocalePhraseTheoryData.cs
  • tests/Humanizer.Tests/Localisation/kn/KannadaNonNumberSurfaceTests.cs
  • tests/Humanizer.Tests/Localisation/kn/KannadaNumberToWordsTests.cs

Comment thread tests/Humanizer.Tests/Localisation/kn/KannadaNumberToWordsTests.cs Outdated

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 Kannada (kn) as a new generated locale for Humanizer, providing localized number-to-words/ordinal/parse data, relative-date/duration phrases, data-unit and time-unit labels, clock notation, compass headings, and calendar months. The PR wires Kannada into the shared cross-locale theory matrices and adds locale-specific exact-output tests.

Changes:

  • New src/Humanizer/Locales/kn.yml containing the full Kannada profile (cardinals 0–999 dense table, Indian-scale forms, ordinal map, parse maps, clock/compass/calendar surfaces).
  • New tests/Humanizer.Tests/Localisation/kn/ tests covering number-to-words round trips, ordinals, time/data unit labels, clock notation, compass headings, and date formatting.
  • Adds kn rows to all shared LocaleCoverageData / LocalePhraseTheoryData / LocaleNumberTheoryData / LocaleNumberOverloadTheoryData / LocaleNumberMagnitudeTheoryData / LocaleOrdinalizerMatrixData / LocaleFormatterExactTheoryData matrices, and updates docs/localization.md to list Kannada.

Reviewed changes

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

Show a summary per file
File Description
src/Humanizer/Locales/kn.yml New 4499-line Kannada locale profile (phrases, numbers, scales, ordinals, parse maps, clock, compass, calendar).
tests/Humanizer.Tests/Localisation/kn/KannadaNumberToWordsTests.cs New exact-output tests for cardinal/ordinal words and round-trip parsing (including long.MinValue).
tests/Humanizer.Tests/Localisation/kn/KannadaNonNumberSurfaceTests.cs New tests for collections, relative dates, durations, time/data unit labels, dates, clock, compass, and ordinalizer.
tests/Humanizer.Tests/Localisation/LocaleCoverageData.cs Adds kn rows to coverage matrices for dates, clock, formatter, collection, ordinal, cardinal, and words-to-number.
tests/Humanizer.Tests/Localisation/LocalePhraseTheoryData.cs Adds kn rows for DateHumanize, NullDateHumanize, and TimeSpanHumanize cases.
tests/Humanizer.Tests/Localisation/LocaleNumberTheoryData.cs Adds kn rows for cardinals, ordinals, word-form/gender variants, tuples, and words-to-number.
tests/Humanizer.Tests/Localisation/LocaleNumberOverloadTheoryData.cs Adds kn rows for long overloads (AddAnd/WordForm/Gender/WordFormGender).
tests/Humanizer.Tests/Localisation/LocaleNumberMagnitudeTheoryData.cs Adds kn rows for magnitude and extended magnitude cardinal cases.
tests/Humanizer.Tests/Localisation/LocaleOrdinalizerMatrixData.cs Adds kn rows across all ordinalizer matrices (numeric, string, gender, word-form, negative).
tests/Humanizer.Tests/Localisation/LocaleFormatterExactTheoryData.cs Adds kn rows for date-day plural, multi-part timespan, time-unit symbols, byte size, collection humanize, and headings.
docs/localization.md Lists Kannada (kn) in the supported languages line.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 37dd13dec4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/Humanizer/Locales/kn.yml
Copilot AI review requested due to automatic review settings May 14, 2026 01:12

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 11 changed files in this pull request and generated no new comments.

# Conflicts:
#	docs/localization.md
#	tests/Humanizer.Tests/Localisation/LocaleCoverageData.cs
#	tests/Humanizer.Tests/Localisation/LocaleFormatterExactTheoryData.cs
#	tests/Humanizer.Tests/Localisation/LocaleNumberMagnitudeTheoryData.cs
#	tests/Humanizer.Tests/Localisation/LocaleNumberOverloadTheoryData.cs
#	tests/Humanizer.Tests/Localisation/LocaleNumberTheoryData.cs
#	tests/Humanizer.Tests/Localisation/LocaleOrdinalizerMatrixData.cs
#	tests/Humanizer.Tests/Localisation/LocalePhraseTheoryData.cs
Copilot AI review requested due to automatic review settings May 14, 2026 02:57

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 11 changed files in this pull request and generated no new comments.

# Conflicts:
#	docs/localization.md
#	tests/Humanizer.Tests/Localisation/LocaleFormatterExactTheoryData.cs
#	tests/Humanizer.Tests/Localisation/LocaleNumberMagnitudeTheoryData.cs
#	tests/Humanizer.Tests/Localisation/LocaleNumberOverloadTheoryData.cs
#	tests/Humanizer.Tests/Localisation/LocaleNumberTheoryData.cs
#	tests/Humanizer.Tests/Localisation/LocaleOrdinalizerMatrixData.cs
#	tests/Humanizer.Tests/Localisation/LocalePhraseTheoryData.cs
Copilot AI review requested due to automatic review settings May 14, 2026 03:35

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 11 changed files in this pull request and generated no new comments.

@clairernovotny clairernovotny merged commit a5ba445 into main May 14, 2026
8 checks passed
@clairernovotny clairernovotny deleted the feat-kn branch May 14, 2026 04:11
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