Skip to content
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

Added pluralize/singularize functions based on an int count. #1

Merged
merged 1 commit into from Sep 9, 2016

Conversation

ethauvin
Copy link
Contributor

@ethauvin ethauvin commented Sep 6, 2016

"person".pluralize(1)  # => "person"
"person".pluralize(2)  # => "people"

That was needed.

Additionally, you might want to look at Plural.kt. It might be a useful generic pattern.

Ultimately, I'd like to see the patterns, etc. included in resources instead of hard-coded. That will make it a lot easier for people to add/modify rules, and use the library with other languages. Have you looked at Quantity Strings?

Hope this helps,

E.

@cesarferreira
Copy link
Owner

Thanks for the PR :)
Don't you think ternaries would look sexier tho? :)

Thanks for the tips :) I'll work on that direction (extract the rules)

@cesarferreira cesarferreira merged commit 906b9d8 into cesarferreira:master Sep 9, 2016
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.

None yet

2 participants