Skip to content

Conversation

@vgrigoriu
Copy link
Contributor

@vgrigoriu vgrigoriu commented Nov 30, 2025

The current Romanian translation is slightly wrong. Similar to Slavic languages, Romanian has different rules for how plurals look:

  • number + noun if 1 <= n % 100 <= 19
  • number + "de" + noun otherwise

(See Wikipedia.)

@EvanHahn
Copy link
Owner

EvanHahn commented Nov 30, 2025 via email

Copy link
Owner

@EvanHahn EvanHahn left a comment

Choose a reason for hiding this comment

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

This mostly looks good, but I have a few small requests. Thank you!

["minut", "minute"],
["secundă", "secunde"],
["milisecundă", "milisecunde"],
ro: romanianLanguage(
Copy link
Owner

Choose a reason for hiding this comment

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

Nitpick: I'd prefer if this could use language() instead, and remove the romanianLanguage() function. It should just be a matter of inlining the contents of romanianLanguage().

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

assert.strictEqual(h(123), "Zero.OneTwoThree seconds");
});

it("handles Romanian plural forms with 'de' correctly", function () {
Copy link
Owner

Choose a reason for hiding this comment

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

Is there a way to test this inside of test/definitions/ro.tsv instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I put here whatever I couldn't test using the tsv because numbers are too big and would roll into the next unit, e.g. 100 days would be 3 months etc. I can remove these tests if you want, I'm OK with the coverage from ro.tsv.

Copy link
Owner

Choose a reason for hiding this comment

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

I think I'd prefer if these tests were removed. Happy to discuss further if you disagree.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed.

if (c === 1) {
return unit[0];
}
// Non-integers and 0 use plural without "de"
Copy link
Owner

Choose a reason for hiding this comment

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

Nitpick: could you remove this comment?

Suggested change
// Non-integers and 0 use plural without "de"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@vgrigoriu vgrigoriu requested a review from EvanHahn December 1, 2025 19:04
@EvanHahn
Copy link
Owner

EvanHahn commented Dec 1, 2025

I'll take another look soon.

Copy link
Owner

@EvanHahn EvanHahn left a comment

Choose a reason for hiding this comment

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

Looks good other than one small comment! Thank you!

assert.strictEqual(h(123), "Zero.OneTwoThree seconds");
});

it("handles Romanian plural forms with 'de' correctly", function () {
Copy link
Owner

Choose a reason for hiding this comment

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

I think I'd prefer if these tests were removed. Happy to discuss further if you disagree.

@vgrigoriu vgrigoriu requested a review from EvanHahn December 6, 2025 07:57
@EvanHahn EvanHahn merged commit 1d6c3a7 into EvanHahn:main Dec 6, 2025
1 check passed
@EvanHahn
Copy link
Owner

EvanHahn commented Dec 6, 2025

Thanks! I'll deploy this soon.

@vgrigoriu vgrigoriu deleted the push-xqyltoosrrnz branch December 6, 2025 15:28
@EvanHahn
Copy link
Owner

EvanHahn commented Dec 7, 2025

This has been released in humanize-duration@3.33.2. Thanks again!

@vgrigoriu
Copy link
Contributor Author

Hey @EvanHahn, is there a process for updating the code used in the demo page? It looks like the version in the gh-pages branch is two years old.

@EvanHahn
Copy link
Owner

I always forget to update that. I'll fix in the next few days.

@EvanHahn
Copy link
Owner

Updated!

@vgrigoriu
Copy link
Contributor Author

Thanks!

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