Skip to content

Add Hindi locale parity#1738

Merged
clairernovotny merged 14 commits into
mainfrom
add-hindi
May 13, 2026
Merged

Add Hindi locale parity#1738
clairernovotny merged 14 commits into
mainfrom
add-hindi

Conversation

@clairernovotny

Copy link
Copy Markdown
Member

Summary

  • add full Hindi (hi) locale YAML coverage across list formatting, formatter phrases, number words/parsing/formatting, ordinals, dates, clock notation, compass, and calendar months
  • add Hindi exact-output tests under tests/Humanizer.Tests/Localisation/hi
  • extend locale matrix/sweep data for Hindi formatter, phrase, date/clock, number, ordinal, magnitude, and overload coverage

Validation

  • 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 net11.0
  • dotnet test tests/Humanizer.Tests/Humanizer.Tests.csproj --framework net8.0
  • dotnet pack src/Humanizer/Humanizer.csproj -c Release -o artifacts/locale-parity-validation
  • dotnet format Humanizer.slnx --verify-no-changes --verbosity diagnostic
  • git diff --check

Notes:

  • net48 tests were skipped because this host is non-Windows.
  • Source generator tests target net11.0 in this checkout.

- Introduced a new goal prompt template for adding or updating Humanizer locales, providing clear instructions and workflow references.
- Expanded the parity checklist to clarify evidence lanes, surface inventory, and required proof subrows, ensuring comprehensive coverage for locale parity.
- Updated Urdu epic learnings to include detailed failure modes and reusable rules for common pitfalls in locale implementation, focusing on Arabic-script differences, plural rules, and number scales.
Copilot AI review requested due to automatic review settings May 13, 2026 17:15
@coderabbitai

coderabbitai Bot commented May 13, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: ed7daefb-11ea-49c6-946a-d724e0f32558

📥 Commits

Reviewing files that changed from the base of the PR and between 43b0e65 and 3ba3c1c.

📒 Files selected for processing (25)
  • src/Humanizer.SourceGenerators/Common/EngineContractCatalog.cs
  • src/Humanizer.SourceGenerators/Generators/ProfileCatalogs/TimeOnlyToClockNotationEngineContractFactory.cs
  • src/Humanizer/Locales/hi.yml
  • src/Humanizer/Locales/ur.yml
  • src/Humanizer/Localisation/TimeToClockNotation/PhraseClockNotationConverter.cs
  • tests/Humanizer.Tests/CoverageGapTests.cs
  • 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/hi/HindiClockNotationTests.cs
  • tests/Humanizer.Tests/Localisation/hi/HindiCompassTests.cs
  • tests/Humanizer.Tests/Localisation/hi/HindiDataUnitsTests.cs
  • tests/Humanizer.Tests/Localisation/hi/HindiDateToOrdinalWordsTests.cs
  • tests/Humanizer.Tests/Localisation/hi/HindiDurationTests.cs
  • tests/Humanizer.Tests/Localisation/hi/HindiListHumanizeTests.cs
  • tests/Humanizer.Tests/Localisation/hi/HindiNumberFormattingTests.cs
  • tests/Humanizer.Tests/Localisation/hi/HindiNumberToWordsTests.cs
  • tests/Humanizer.Tests/Localisation/hi/HindiOrdinalTests.cs
  • tests/Humanizer.Tests/Localisation/hi/HindiRelativeDateTests.cs
  • tests/Humanizer.Tests/Localisation/hi/HindiTimeUnitTests.cs
  • tests/Humanizer.Tests/Localisation/ur/UrduNumberToWordsTests.cs
💤 Files with no reviewable changes (1)
  • src/Humanizer/Locales/ur.yml

📝 Walkthrough

Summary by CodeRabbit

Release Notes

  • New Features

    • Added complete Hindi language support across all localization features (dates, times, numbers, durations, compass directions, and more).
    • Extended time notation to include "evening" as a distinct day period with configurable start hours.
  • Bug Fixes

    • Improved Urdu locale data accuracy by refining number parsing rules.

Walkthrough

This PR adds comprehensive Hindi locale support to Humanizer alongside a phrase-clock evening period feature. Changes include schema and runtime updates for evening day periods, a complete Hindi locale definition file, augmented test data across multiple coverage datasets, and fourteen new Hindi-specific test suites validating clock notation, date/number formatting, and humanization with gender support.

Changes

Evening Period Feature and Hindi Locale Support

Layer / File(s) Summary
Evening Period Schema and Generator Support
src/Humanizer.SourceGenerators/Common/EngineContractCatalog.cs, src/Humanizer.SourceGenerators/Generators/ProfileCatalogs/TimeOnlyToClockNotationEngineContractFactory.cs
EngineContractCatalog phrase-clock schema adds evening label and start-hour thresholds; TimeOnlyToClockNotationEngineContractFactory extends int32 member support with JSON resolution and invariant-culture parsing fallback.
Evening Period Runtime Implementation
src/Humanizer/Localisation/TimeToClockNotation/PhraseClockNotationConverter.cs, tests/Humanizer.Tests/CoverageGapTests.cs
PhraseClockNotationConverter.ApplyDayPeriod includes evening in day-period checks; GetDayPeriod selects afternoon/evening/night based on hour thresholds; PhraseClockNotationProfile adds evening, eveningStartHour, nightStartHour properties; tests validate 18:0 (evening) and 21:0 (night) fixed-bucket ranges.
Hindi Locale Definition
src/Humanizer/Locales/hi.yml, src/Humanizer/Locales/ur.yml
Comprehensive 655-line Hindi locale file defines surfaces, relative dates, duration units, number-to-words with grammatical gender, ordinal formatting, phrase-clock with evening period, compass directions, and calendar months; Urdu locale removes unsupported decimal token.
Test Data Augmentation
tests/Humanizer.Tests/Localisation/LocaleCoverageData.cs, LocaleFormatterExactTheoryData.cs, LocaleNumberMagnitudeTheoryData.cs, LocaleNumberOverloadTheoryData.cs, LocaleNumberTheoryData.cs, LocaleOrdinalizerMatrixData.cs, LocalePhraseTheoryData.cs
Extended across 45 ranges with Hindi expectations for ordinal dates, clock notation, relative dates, collections, byte sizes, headings, cardinal/ordinal numbers, tuples, and time-span humanization.
Hindi-Specific Test Suites
tests/Humanizer.Tests/Localisation/hi/*, tests/Humanizer.Tests/Localisation/ur/UrduNumberToWordsTests.cs
Fourteen new Hindi test files covering clock notation, compass, data units, date ordinals, duration, list humanization, number formatting/parsing, ordinals with gender, relative dates, and time units; Urdu tests validate unsupported decimal phrase rejection.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 A Hindi tongue now hops through clocks,
Where evening softly ticks the locks,
From dawn to night, the words align,
With gendered grace and design so fine,
Humanizer celebrates the tongue divine! ✨

🚥 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 clearly and concisely describes the main objective: adding Hindi locale support (parity). This accurately reflects the primary change across all file modifications.
Description check ✅ Passed The description is well-structured and directly related to the changeset. It outlines the Hindi locale additions, test coverage, validation methods, and framework testing performed, all of which align with the actual code changes.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch add-hindi

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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

This PR adds Hindi (hi) locale parity coverage for Humanizer’s localization surfaces, including exact-output tests for formatting, dates, numbers, clock notation, compass directions, lists, and units. It also includes unrelated workflow/tooling removals that appear outside the stated Hindi locale scope.

Changes:

  • Added Hindi locale data coverage and exact-output tests.
  • Extended shared locale theory/matrix data with Hindi cases.
  • Removed Flow-Next/Ralph/Codex workflow files and related contributor instructions.

Reviewed changes

Copilot reviewed 176 out of 289 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/Humanizer.Tests/Localisation/hi/* Adds Hindi-specific exact-output tests.
tests/Humanizer.Tests/Localisation/Locale*TheoryData.cs Adds Hindi rows to shared locale theory data.
.agents/skills/add-locale/references/goal-prompt-template.md Adds a reusable add-locale goal prompt template.
CLAUDE.md, AGENTS.md Removes Flow-Next contributor instructions.
.flow/**, .codex/**, scripts/ralph/** Deletes repository workflow/tooling metadata and scripts.
tools/verification-signoff.md Updates a verification signoff row.
Comments suppressed due to low confidence (1)

.flow/config.json:1

  • This deletes the tracked Flow-Next configuration/state, while the PR is scoped to adding Hindi locale parity. Removing the repository's task metadata/tooling is unrelated to the locale change and can break contributors or automation that rely on .flow; please restore these files or split the workflow removal into a separately described PR.

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

Comment thread CLAUDE.md

@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: 26237cc809

ℹ️ 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/hi.yml
Comment thread src/Humanizer/Locales/hi.yml

@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: 0ed3fd92e8

ℹ️ 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/hi.yml Outdated
Copilot AI review requested due to automatic review settings May 13, 2026 17: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 176 out of 293 changed files in this pull request and generated 2 comments.

Comment thread CLAUDE.md
Comment thread tests/Humanizer.Tests/Localisation/hi/HindiNumberFormattingTests.cs Outdated
Copilot AI review requested due to automatic review settings May 13, 2026 17:52

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

@clairernovotny clairernovotny enabled auto-merge (squash) May 13, 2026 18:03
@clairernovotny clairernovotny merged commit 844d553 into main May 13, 2026
12 checks passed
@clairernovotny clairernovotny deleted the add-hindi branch May 13, 2026 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants