Skip to content

Conversation

@fravalpin
Copy link
Contributor

Hi! I’m trying to add Catalan as a new language, but I’m running into some issues just trying to get the bare minimum working.

First, I had to change the src/Humanizer/TimeSpanHumanizeExtensions.cs file because when compiling on .NET 8 I got this error:

error CS0023: Operator '.' cannot be applied to operand of type 'void'

Let me know if I should just drop this change, since it probably shouldn’t be happening anyway.

On another note, whenever I try to run build.cmd or build.ps1, I keep getting errors related to Kurdish language. I tried installing it—as suggested in another issue—but no luck.

I’m attaching a screenshot showing all tests passing in Visual Studio.

image

@fravalpin
Copy link
Contributor Author

the error I’m seeing in Humanizer-CI with PublicApiApprovalTest.Approve_Public_Api.DotNet10_0 looks like it’s related to the .NET 10 version.

@clairernovotny
Copy link
Member

The NET 10.0 SDK stuff should be fixed now

Copilot AI review requested due to automatic review settings September 26, 2025 07:47
Copy link
Contributor

Copilot AI left a comment

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 comprehensive Catalan localization support to the Humanizer library, including date/time formatting, number-to-words conversion, ordinal number formatting, and various humanization features. The implementation follows the existing localization patterns in the codebase and provides culturally appropriate Catalan translations.

Key changes:

  • Added complete Catalan resource translations for all humanization features
  • Implemented Catalan-specific formatters and converters for numbers, dates, and time expressions
  • Added comprehensive test coverage for all Catalan localization features

Reviewed Changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/Humanizer/Properties/Resources.ca.resx Complete Catalan resource file with translations for all humanization strings
src/Humanizer/Localisation/TimeToClockNotation/CaTimeOnlyToClockNotationConverter.cs Time-to-clock notation converter with Catalan-specific formatting
src/Humanizer/Localisation/Ordinalizers/CatalanOrdinalizer.cs Ordinal number formatter supporting Catalan gender agreements
src/Humanizer/Localisation/NumberToWords/CatalanNumberToWordsConverter.cs Comprehensive number-to-words converter with Catalan grammar rules
src/Humanizer/Localisation/Formatters/CatalanFormatter.cs Main formatter handling gender-specific time unit formatting
src/Humanizer/Localisation/DateToOrdinalWords/*.cs Date-to-ordinal-words converters for both DateTime and DateOnly
src/Humanizer/Configuration/*.cs Registry updates to include Catalan converters and formatters
src/Humanizer.Tests/Localisation/ca/*.cs Comprehensive test suite covering all Catalan localization features

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +109 to +112
if (thousands == 1)
thousandPart = "mil";
else
thousandPart = $"{Convert(thousands, gender)} mil";

Check notice

Code scanning / CodeQL

Missed ternary opportunity Note

Both branches of this 'if' statement write to the same variable - consider using '?' to express intent better.
Comment on lines +128 to +131
if (millions == 1)
millionPart = "un milió";
else
millionPart = $"{Convert(millions, GrammaticalGender.Masculine)} milions";

Check notice

Code scanning / CodeQL

Missed ternary opportunity Note

Both branches of this 'if' statement write to the same variable - consider using '?' to express intent better.
if (number == 22) return gender == GrammaticalGender.Feminine ? "22a" : "22n";
if (number == 31) return gender == GrammaticalGender.Feminine ? "31a" : "31r";
if (number == 11 || number == 100 || number == 999)
return number.ToString() + (gender == GrammaticalGender.Feminine ? "a" : "è");

Check notice

Code scanning / CodeQL

Redundant ToString() call Note

Redundant call to 'ToString' on a String object.
return gender == GrammaticalGender.Feminine ? "999a" : "999è";
// Comportamiento genérico
if (gender == GrammaticalGender.Feminine)
return number.ToString() + "a";

Check notice

Code scanning / CodeQL

Redundant ToString() call Note

Redundant call to 'ToString' on a String object.
// Comportamiento genérico
if (gender == GrammaticalGender.Feminine)
return number.ToString() + "a";
return number.ToString() + (

Check notice

Code scanning / CodeQL

Redundant ToString() call Note

Redundant call to 'ToString' on a String object.
@clairernovotny clairernovotny enabled auto-merge (squash) October 8, 2025 21:23
Copilot AI review requested due to automatic review settings October 8, 2025 22:36
Copy link
Contributor

Copilot AI left a comment

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


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copilot AI review requested due to automatic review settings October 8, 2025 22:57
Copy link
Contributor

Copilot AI left a comment

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


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copilot AI review requested due to automatic review settings October 8, 2025 23:43
Copy link
Contributor

Copilot AI left a comment

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 24 out of 24 changed files in this pull request and generated 1 comment.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +28 to +31
azure-pipelines.yml = azure-pipelines.yml
build.cmd = build.cmd
build.ps1 = build.ps1
Humanizer.ruleset = Humanizer.ruleset
Copy link

Copilot AI Oct 8, 2025

Choose a reason for hiding this comment

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

The path prefixes were changed from relative paths (starting with '.') to simple filenames. Ensure these files are accessible from the updated paths.

Copilot uses AI. Check for mistakes.
@clairernovotny clairernovotny enabled auto-merge (squash) October 8, 2025 23:45
@clairernovotny clairernovotny merged commit b98332a into Humanizr:main Oct 8, 2025
6 checks passed
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