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

add a string utility for pluralizing #12

Closed
arschles opened this issue Apr 25, 2016 · 3 comments
Closed

add a string utility for pluralizing #12

arschles opened this issue Apr 25, 2016 · 3 comments

Comments

@arschles
Copy link

It would be a nice utility to be able to pluralize a string. For example, {{ pluralize 1 "anchovy" "anchovies" }} would return anchovy, but ``{{ pluralize 2 "anchovy" "anchovies" }}would returnanchovies`

@technosophos
Copy link
Member

Great idea.

On Sun, Apr 24, 2016, 6:18 PM Aaron Schlesinger notifications@github.com
wrote:

It would be a nice utility to be able to pluralize a string. For example, {{
pluralize 1 "anchovy" "anchovies" }} would return anchovy, but `{{
pluralize 2 "anchovy" "anchovies" }} would return anchovies


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#12

@technosophos
Copy link
Member

I'm trying to figure out what the right order of params would be. Is it more likely to be: {{len foo | pluralize "anchovy" "anchovies"}}?

Optionally, we could do {{pluralize "1 thinger", "%d thingers" $len}} and do the substitution for the user.

@technosophos
Copy link
Member

Okay, that last part was a bad idea, since it would then require a %d, which is silly.

    functions_test.go:391: Expected 'cheese', got 'cheese%!(EXTRA int=1)'

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

No branches or pull requests

2 participants