-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Properly handle Dutch year numbers #183
Conversation
Great! At least for English, I would add an option to pass (e.g. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is OK.
I commented about my preferred style, but it is not compulsory. If there are no objections, I should commit it over the weekend.
if figures.number_in_capacity(1) == 1 | ||
if figures.hundreds | ||
teen_hundreds = @figures[2, 2].to_figures | ||
[([@translations.teens(teen_hundreds), translate(:hundreds, 1)] + simple_number_to_words).join] | ||
else | ||
simple_number_to_words + [translate(:mega, 1)] | ||
end | ||
else | ||
super | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just a personal preference, how about?:
return super unless figures.number_in_capacity(1) == 1
if figures.hundreds
teen_hundreds = @figures[2, 2].to_figures
[([@translations.teens(teen_hundreds), translate(:hundreds, 1)] +
simple_number_to_words).join]
else
simple_number_to_words + [translate(:mega, 1)]
end
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's better. Updated.
Changes the handling of, e.g., 1984, to use nineteenhundred-style instead of one thousand nine hundred.
09deac6
to
42dd709
Compare
I'm going to do do a bit of research on whether in Dutch this change is always good, or only for years. |
I'm going to update this PR make this an option. |
7cb9051
to
c7c27d4
Compare
The teenhundreds style is generally used with years, not so much with other numbers. Still to do:
|
This style of pronunciation is mostly used for years.
c7c27d4
to
78b0bef
Compare
78b0bef
to
af86e9d
Compare
Maybe |
Yes, if I understand what this commit is about. Based on (US) English:
Or poke the CMOS for more inspiration. If I understand correctly, you are trying to implement the second option? |
I'm trying to implement the third option for Dutch. Both the second and third options are possible in Dutch. |
@mvz want to finish this? or should we merge as is? |
@dblock I'll take another look and hopefully finish this in the coming weekend. |
@mvz can take a look on green |
eeb3d78
to
8627483
Compare
@dblock it's ready now as far as I'm concerned. I've renamed the option to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mvz care to please add to the change log/readme so we don’t forget? There’s no rush to merge. Thanks for contributing!
If there are no objections, I can add the missing CHANGELOG entry this weekend and commit. Thank you! |
Release 0.11.12 (April 22, 2023) Features: - Add support for Ruby 3.1. \[[#187](https://github.com/kslazarev/numbers_and_words/pull/187)\] - Drop support for Ruby 2.5. \[[#180](https://github.com/kslazarev/numbers_and_words/pull/180)\] - Drop support for Ruby 2.6. \[[#190](https://github.com/kslazarev/numbers_and_words/pull/190)\] - Add support for Ruby 3.2. \[[#193](https://github.com/kslazarev/numbers_and_words/pull/193)\] Bugs: - Properly handle Dutch year numbers. \[[#183](https://github.com/kslazarev/numbers_and_words/pull/183)\] \([@mvz](https://github.com/mvz)\) - Remove pluralization rules for French. \[[#195](https://github.com/kslazarev/numbers_and_words/pull/195)\]
Changes the handling of, e.g., 1984, to use nineteenhundred-style instead of one thousand nine hundred.
This solution is slightly hacky at the moment. If this logic makes sense for other languages (English and German, perhaps?) I can create some helper methods.