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

Pluralize templating breaks when string includes an apostrophe #23

Open
AnthonyP4312 opened this issue Jul 26, 2019 · 0 comments
Open

Comments

@AnthonyP4312
Copy link

I've been using Humanizer in a kotlin project recently and was trying to use the pluralize method however I ran into an interesting bug.

val result = Humanize.pluralize(
        "string with a single thing",
        "string with {1} things",
        "string with no things",
        3,
        "three"
)

println(result)
// => "string with three things"

This usage properly works and will template the value three into the many parameter.
However, if I add an apostrophe somewhere in the string, the templating no longer works,
and the apostrophe is removed.

val result = Humanize.pluralize(
        "string with a single thing",
        "can't use string with {1} things",
        "string with no things",
        3,
        "three"
)

println(result)
// => "cant use string with {1} things"
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

1 participant