-
Notifications
You must be signed in to change notification settings - Fork 966
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
add russian translation for ToWords #147
Conversation
|
{ | ||
public NumberToWordsTests() : base("ru-RU") { } | ||
|
||
[InlineData(0, "ноль")] |
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.
Holy crap!! ;)
#149 is merged now :) |
|
{ | ||
if (number == 0) | ||
return "cero"; | ||
|
||
if (number < 0) | ||
return string.Format("menos {0}", Convert(Math.Abs(number))); | ||
return string.Format("menos {0}", Convert(Math.Abs(number), gender)); |
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.
I think this changes to a white-space need to be reverted.
I think commits related to #74 shall go to a separate pull request. Everything else looks good. |
/// <summary> | ||
/// Options for specifying the desired grammatical case for the output words | ||
/// </summary> | ||
public enum GrammaticalCase |
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.
Cool. Thanks for promoting this.
Currently I found a better way to add |
|
||
return resourceKey; | ||
var grammaticalNumber = RussianGrammaticalNumberDetector.Detect(number); | ||
var suffix = _map[(int) grammaticalNumber]; |
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.
I don't like to depend on implicit order of enum members. I will change this to two if conditions.
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.
Ok, I'll address this.
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.
Cool. Can you pop on Skype for a sec please? I'm www.mehdi-khalili.com
@MehdiK here we go |
@@ -410,6 +410,15 @@ Humanizer can change numbers to words using the `ToWords` extension: | |||
3501.ToWords() => "three thousand five hundred and one" | |||
``` | |||
|
|||
You can also pass a second argument, `GrammaticalGender`, to `ToWords` to specify which gender the number should be outputted in. The possible values are `GrammaticalGender.Masculine`, `GrammaticalGender.Feminine` and `GrammaticalGender.Neuter`. |
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.
Thanks for this :)
Nice work @mexx. This is going to make things very simple for others. Thanks a lot. Merged now. |
I will have to go further with ToWords as it also affected by the grammatical case, currently we have |
This is now published to NuGet as v1.21.1. Thanks. |
No description provided.