Add Somali locale parity - #1782
Conversation
📝 WalkthroughSummary by CodeRabbitRelease NotesNew Features
WalkthroughThis pull request adds complete Somali locale support to the Humanizer library by introducing a Somali locale configuration file and comprehensive test coverage across shared test matrices and culture-specific test suites. ChangesSomali Locale Addition
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 docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
tests/Humanizer.Tests/Localisation/so/SomaliNumberToWordsTests.cs (1)
6-6: ⚡ Quick winRename private culture field to camelCase.
Sois private and should follow camelCase (for example,so) to match repository conventions.As per coding guidelines: "Naming convention: use camelCase for private fields, PascalCase for public members/constants/static readonly".
🤖 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/so/SomaliNumberToWordsTests.cs` at line 6, Rename the private static readonly field So to camelCase (so) to follow private-field naming conventions; update the declaration "static readonly CultureInfo So" to "static readonly CultureInfo so" and then update all references in the class/tests (e.g., in SomaliNumberToWordsTests methods) to use "so" instead of "So".tests/Humanizer.Tests/Localisation/so/SomaliListAndUnitTests.cs (1)
6-7: ⚡ Quick winUse camelCase for private static readonly test fields.
PairandTripleare private fields and should follow camelCase naming (pair,triple) for consistency with repo conventions.As per coding guidelines: "Naming convention: use camelCase for private fields, PascalCase for public members/constants/static readonly".
🤖 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/so/SomaliListAndUnitTests.cs` around lines 6 - 7, Rename the private static readonly test fields Pair and Triple to use camelCase (pair, triple) in SomaliListAndUnitTests and update all references within that file (and any related tests) to the new names; ensure the declarations (currently "static readonly int[] Pair" and "static readonly int[] Triple") and every usage in methods/assertions are changed to "pair" and "triple" respectively to comply with private field naming conventions.
🤖 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/so/SomaliListAndUnitTests.cs`:
- Around line 6-7: Rename the private static readonly test fields Pair and
Triple to use camelCase (pair, triple) in SomaliListAndUnitTests and update all
references within that file (and any related tests) to the new names; ensure the
declarations (currently "static readonly int[] Pair" and "static readonly int[]
Triple") and every usage in methods/assertions are changed to "pair" and
"triple" respectively to comply with private field naming conventions.
In `@tests/Humanizer.Tests/Localisation/so/SomaliNumberToWordsTests.cs`:
- Line 6: Rename the private static readonly field So to camelCase (so) to
follow private-field naming conventions; update the declaration "static readonly
CultureInfo So" to "static readonly CultureInfo so" and then update all
references in the class/tests (e.g., in SomaliNumberToWordsTests methods) to use
"so" instead of "So".
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 2c0d83a6-c917-4d5b-b1c7-84ece76026ed
📒 Files selected for processing (15)
src/Humanizer/Locales/so.ymltests/Humanizer.Tests/Localisation/LocaleCoverageData.cstests/Humanizer.Tests/Localisation/LocaleFormatterExactTheoryData.cstests/Humanizer.Tests/Localisation/LocaleNumberMagnitudeTheoryData.cstests/Humanizer.Tests/Localisation/LocaleNumberOverloadTheoryData.cstests/Humanizer.Tests/Localisation/LocaleNumberTheoryData.cstests/Humanizer.Tests/Localisation/LocaleOrdinalizerMatrixData.cstests/Humanizer.Tests/Localisation/LocalePhraseTheoryData.cstests/Humanizer.Tests/Localisation/so/SomaliClockNotationTests.cstests/Humanizer.Tests/Localisation/so/SomaliCompassTests.cstests/Humanizer.Tests/Localisation/so/SomaliDateToOrdinalWordsTests.cstests/Humanizer.Tests/Localisation/so/SomaliListAndUnitTests.cstests/Humanizer.Tests/Localisation/so/SomaliNumberToWordsTests.cstests/Humanizer.Tests/Localisation/so/SomaliOrdinalTests.cstests/Humanizer.Tests/Localisation/so/SomaliPhraseTests.cs
There was a problem hiding this comment.
Pull request overview
Adds full Somali (so) locale support to Humanizer by introducing a complete locale YAML profile and aligning the test/coverage matrix so Somali participates in the same “locale parity” validation as other shipped locales.
Changes:
- Added
so.ymlimplementing Somali list formatting, phrases (relative dates/durations), number-to-words + words-to-number parsing, ordinals, clock notation, compass headings, and calendar month names. - Added Somali-specific exact-output tests for key localized surfaces (numbers/parsing, ordinals, dates, clock notation, lists, units, phrases, compass headings).
- Extended shared locale theory/coverage datasets so Somali is included in locale-sweep completeness testing.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Humanizer.Tests/Localisation/so/SomaliPhraseTests.cs | Adds Somali phrase coverage for relative dates, null-date “never”, durations, and age formatting. |
| tests/Humanizer.Tests/Localisation/so/SomaliOrdinalTests.cs | Validates Somali ordinalization (numeric suffix + ordinal words, including negatives). |
| tests/Humanizer.Tests/Localisation/so/SomaliNumberToWordsTests.cs | Adds Somali number-to-words expectations plus words-to-number round-trips for cardinals/ordinals. |
| tests/Humanizer.Tests/Localisation/so/SomaliListAndUnitTests.cs | Verifies Somali list conjunction rules and localized unit labels/symbols. |
| tests/Humanizer.Tests/Localisation/so/SomaliDateToOrdinalWordsTests.cs | Validates Somali date formatting for ToOrdinalWords (DateTime/DateOnly). |
| tests/Humanizer.Tests/Localisation/so/SomaliCompassTests.cs | Adds Somali compass heading expectations (full + abbreviated). |
| tests/Humanizer.Tests/Localisation/so/SomaliClockNotationTests.cs | Validates Somali TimeOnly.ToClockNotation exact and rounded outputs. |
| tests/Humanizer.Tests/Localisation/LocalePhraseTheoryData.cs | Adds Somali rows for shared phrase theory coverage (date humanize, null-date, duration). |
| tests/Humanizer.Tests/Localisation/LocaleOrdinalizerMatrixData.cs | Adds Somali rows to the ordinalizer matrix (numeric/string, genders, word forms, negatives). |
| tests/Humanizer.Tests/Localisation/LocaleNumberTheoryData.cs | Adds Somali rows for shared number/ordinal expectations and parsing cases. |
| tests/Humanizer.Tests/Localisation/LocaleNumberOverloadTheoryData.cs | Adds Somali rows for overload-based number-to-words parity datasets. |
| tests/Humanizer.Tests/Localisation/LocaleNumberMagnitudeTheoryData.cs | Adds Somali magnitude/extended magnitude expectations and high-range round-trip coverage. |
| tests/Humanizer.Tests/Localisation/LocaleFormatterExactTheoryData.cs | Adds Somali entries for shared formatter exact-output datasets (dates, durations, units, lists, headings). |
| tests/Humanizer.Tests/Localisation/LocaleCoverageData.cs | Adds Somali to locale-coverage expectation datasets (dates, clock notation, lists, ordinals, numbers, parsing). |
| src/Humanizer/Locales/so.yml | Introduces the Somali locale YAML profile covering all canonical localization surfaces. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
so) locale YAML covering all canonical localized surfacesValidation