Skip to content

Add Basque locale parity - #1778

Merged
clairernovotny merged 4 commits into
mainfrom
feat-eu
May 16, 2026
Merged

Add Basque locale parity#1778
clairernovotny merged 4 commits into
mainfrom
feat-eu

Conversation

@clairernovotny

Copy link
Copy Markdown
Member

Summary\n- add Basque (eu) locale YAML covering formatter, phrases, numbers, parsing, ordinals, clock, compass, and calendar surfaces\n- add Basque locale parity tests and matrix coverage\n\n## Tests\n- dotnet test --project tests/Humanizer.SourceGenerators.Tests/Humanizer.SourceGenerators.Tests.csproj --framework net10.0\n- dotnet test --project tests/Humanizer.Tests/Humanizer.Tests.csproj --framework net10.0\n- dotnet test --project tests/Humanizer.Tests/Humanizer.Tests.csproj --framework net8.0\n- dotnet test --project tests/Humanizer.Tests/Humanizer.Tests.csproj --framework net11.0\n- dotnet pack src/Humanizer/Humanizer.csproj -c Release -o artifacts/locale-parity-validation\n\nParity map: artifacts/2026-05-16-eu-parity-map.md (local, gitignored)

Copilot AI review requested due to automatic review settings May 16, 2026 19:45
@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 full Basque (eu) locale support: a new eu.yml locale file with number/ordinal rules, date/time/duration phrasing, clock and compass templates, and extensive test rows plus a parity test suite verifying formatting and parsing.

Changes

Basque locale support

Layer / File(s) Summary
Basque locale definition
src/Humanizer/Locales/eu.yml
Complete Basque locale configuration supplying list/formatter settings, time-unit genders, relative-date and duration phrasing, number-to-words rendering with gender and word-form support, parsing rules with token normalization, ordinal exceptions and suffix formatting, clock notation templates, compass direction and calendar month labels.
Test data additions across locale datasets
tests/Humanizer.Tests/Localisation/LocaleCoverageData.cs, LocaleFormatterExactTheoryData.cs, LocaleNumberMagnitudeTheoryData.cs, LocaleNumberOverloadTheoryData.cs, LocaleNumberTheoryData.cs, LocaleOrdinalizerMatrixData.cs, LocalePhraseTheoryData.cs, docs/localization.md
Extends multiple test data files with Basque test cases covering date-to-ordinal words, time-to-clock notation, relative date phrases ("now"/"never"), collection joining, byte-size symbols/words, cardinal/ordinal number words across genders and word forms, magnitude cardinals, words-to-number parsing, and time-span expectations; updates documented locale file count.
Basque locale parity test suite
tests/Humanizer.Tests/Localisation/eu/BasqueLocaleParityTests.cs
Integration tests validating Basque cardinals/ordinals, words-to-number parsing, numeric ordinal suffix formatting, date/time phrase humanization, collection conjunctions, ordinal-date patterns, TimeOnly clock-notation, and compass heading labels.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 I nibble words in Basque delight,
Ordinals dotted, clocks that say "eta",
Lists join softly with a hopping "eta",
Tests hop in to check each phrase and date,
Locale blooms — the rabbit twitches its whiskers.

🚥 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 change: adding Basque locale parity to the Humanizer library, which matches the core objective of the changeset.
Description check ✅ Passed The description accurately summarizes the changeset: adding Basque locale YAML configuration and parity tests, including specific frameworks tested and validation methods.
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-eu

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.

🧹 Nitpick comments (1)
tests/Humanizer.Tests/Localisation/LocaleNumberOverloadTheoryData.cs (1)

7-8: ⚡ Quick win

Remove redundant blank lines after Basque test entries.

The blank lines added after each "eu" test case entry (lines 8, 262, 515, 768) don't follow the existing pattern in this file, where consecutive entries within the same locale group are not separated by blank lines. As per coding guidelines, trim redundant blank lines.

♻️ Proposed fix

Remove the blank lines at lines 8, 262, 515, and 768:

     public static TheoryData<string, long, string> AddAndCases => new()
     {
         { "eu", 1000001L, "milioi bat" },
-
         { "et", 1001001L, "miljon tuhat üks" },

Apply the same change to lines 262, 515, and 768 in the WordFormCases, GenderCases, and WordFormGenderCases properties respectively.

Also applies to: 261-262, 514-515, 767-768

🤖 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 `@tests/Humanizer.Tests/Localisation/LocaleNumberOverloadTheoryData.cs` around
lines 7 - 8, Remove the redundant blank lines inserted after the Basque ("eu")
test entries—specifically the entry { "eu", 1000001L, "milioi bat" }—so the
locale group remains contiguous; update the three properties WordFormCases,
GenderCases, and WordFormGenderCases to delete the extra blank lines following
the "eu" entries (the ones currently after the Basque lines in each property) so
they match the existing pattern of consecutive locale entries without blank
lines.
🤖 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.

Nitpick comments:
In `@tests/Humanizer.Tests/Localisation/LocaleNumberOverloadTheoryData.cs`:
- Around line 7-8: Remove the redundant blank lines inserted after the Basque
("eu") test entries—specifically the entry { "eu", 1000001L, "milioi bat" }—so
the locale group remains contiguous; update the three properties WordFormCases,
GenderCases, and WordFormGenderCases to delete the extra blank lines following
the "eu" entries (the ones currently after the Basque lines in each property) so
they match the existing pattern of consecutive locale entries without blank
lines.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: df9c3c76-533c-4b39-90c7-e4c56059732b

📥 Commits

Reviewing files that changed from the base of the PR and between 84416b5 and a5a4fea.

📒 Files selected for processing (9)
  • src/Humanizer/Locales/eu.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/eu/BasqueLocaleParityTests.cs

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 Basque (eu) locale support across generated locale YAML surfaces and locale parity/matrix tests.

Changes:

  • Adds src/Humanizer/Locales/eu.yml with Basque formatter, numbers, parsing, ordinals, clock, compass, and calendar data.
  • Adds Basque-specific parity tests.
  • Extends shared locale theory/matrix coverage with eu rows.

Reviewed changes

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

Show a summary per file
File Description
src/Humanizer/Locales/eu.yml Defines Basque locale data for generated runtime surfaces.
tests/Humanizer.Tests/Localisation/eu/BasqueLocaleParityTests.cs Adds focused Basque locale parity tests.
tests/Humanizer.Tests/Localisation/LocalePhraseTheoryData.cs Adds Basque phrase expectations.
tests/Humanizer.Tests/Localisation/LocaleOrdinalizerMatrixData.cs Adds Basque ordinalizer matrix rows.
tests/Humanizer.Tests/Localisation/LocaleNumberTheoryData.cs Adds Basque number, ordinal, and parsing rows.
tests/Humanizer.Tests/Localisation/LocaleNumberOverloadTheoryData.cs Adds Basque long overload rows.
tests/Humanizer.Tests/Localisation/LocaleNumberMagnitudeTheoryData.cs Adds Basque magnitude rows.
tests/Humanizer.Tests/Localisation/LocaleFormatterExactTheoryData.cs Adds Basque exact formatter rows.
tests/Humanizer.Tests/Localisation/LocaleCoverageData.cs Adds Basque rows for locale coverage completeness.
Comments suppressed due to low confidence (1)

src/Humanizer/Locales/eu.yml:109

  • This exact “two days from now” phrase is unreachable with the current formatter profile. ProfiledFormatter only selects a template named “two” when surfaces.formatter.exactDateForms contains a number-2 rule for that unit/tense; eu.yml does not define one, so DateHumanize(Day, Future, 2) will always return the generic counted phrase instead of “etzi”.
          template:
            name: 'two'
            value: 'etzi'

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

Comment thread src/Humanizer/Locales/eu.yml Outdated
Comment on lines +238 to +239
joinWord: ' '
scaleCountJoinWord: ' '
Comment thread src/Humanizer/Locales/eu.yml Outdated
ordinalGenderVariant: 'none'
negativePrefixes:
- 'minus '
ignoredTokens: []
Comment thread src/Humanizer/Locales/eu.yml
Comment on lines +3051 to +3054
{ "eu", 101, "ehun bat" },
{ "eu", 121, "ehun hogeita bat" },
{ "eu", 200, "berrehun" },
{ "eu", 999, "bederatziehun laurogeita hemeretzi" },
{
public static TheoryData<string, long, string> MagnitudeCardinalCases => new()
{
{ "eu", 1001L, "mila bat" },
{ "eu", 999, "bederatziehun laurogeita hemeretzi" },
{ "eu", 1000, "mila" },
{ "eu", 1001, "mila bat" },
{ "eu", 3500, "hiru mila bostehun" },
Comment thread src/Humanizer/Locales/eu.yml
Comment on lines +1252 to +1253
{ "eu", 2, TimeUnit.Day, Tense.Past, "duela 2 egun" },
{ "eu", 2, TimeUnit.Day, Tense.Future, "2 egun barru" },
{ "lo", new("2 ມື້ ກ່ອນ", "3 ມື້ ກ່ອນ", "4 ມື້ ກ່ອນ", "5 ມື້ ກ່ອນ", "11 ມື້ ກ່ອນ", "21 ມື້ ກ່ອນ", "ໃນອີກ 2 ມື້", "ໃນອີກ 3 ມື້", "ໃນອີກ 4 ມື້", "ໃນອີກ 5 ມື້", "ໃນອີກ 11 ມື້", "ໃນອີກ 21 ມື້") },
{ "mn", new("2 хоногийн өмнө", "3 хоногийн өмнө", "4 хоногийн өмнө", "5 хоногийн өмнө", "11 хоногийн өмнө", "21 хоногийн өмнө", "2 хоногийн дараа", "3 хоногийн дараа", "4 хоногийн дараа", "5 хоногийн дараа", "11 хоногийн дараа", "21 хоногийн дараа") },
{ "ky", new("2 күн мурун", "3 күн мурун", "4 күн мурун", "5 күн мурун", "11 күн мурун", "21 күн мурун", "2 күндөн кийин", "3 күндөн кийин", "4 күндөн кийин", "5 күндөн кийин", "11 күндөн кийин", "21 күндөн кийин") },
{ "eu", new("duela 2 egun", "duela 3 egun", "duela 4 egun", "duela 5 egun", "duela 11 egun", "duela 21 egun", "2 egun barru", "3 egun barru", "4 egun barru", "5 egun barru", "11 egun barru", "21 egun barru") },
Assert.Equal("orain", formatter.DateHumanize_Now());
Assert.Equal("inoiz ez", formatter.DateHumanize_Never());
Assert.Equal("atzo", formatter.DateHumanize(TimeUnit.Day, Tense.Past, 1));
Assert.Equal("2 egun barru", formatter.DateHumanize(TimeUnit.Day, Tense.Future, 2));
Copilot AI review requested due to automatic review settings May 16, 2026 20:26

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 9 comments.

Comment thread src/Humanizer/Locales/eu.yml
Comment thread src/Humanizer/Locales/eu.yml
Comment thread tests/Humanizer.Tests/Localisation/LocaleNumberTheoryData.cs
Comment thread src/Humanizer/Locales/eu.yml
Comment thread tests/Humanizer.Tests/Localisation/eu/BasqueLocaleParityTests.cs
Comment thread src/Humanizer/Locales/eu.yml
Comment thread tests/Humanizer.Tests/Localisation/eu/BasqueLocaleParityTests.cs
Comment thread src/Humanizer/Locales/eu.yml
Comment thread tests/Humanizer.Tests/Localisation/LocaleNumberTheoryData.cs
Copilot AI review requested due to automatic review settings May 16, 2026 21:01

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 3 comments.

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

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 bc9a328 into main May 16, 2026
12 checks passed
@clairernovotny
clairernovotny deleted the feat-eu branch May 16, 2026 21:59
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