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

A collection formatter for the current culture has not been implemented yet #392

Closed
Bartmax opened this issue Mar 4, 2015 · 6 comments
Closed

Comments

@Bartmax
Copy link

Bartmax commented Mar 4, 2015

I'm pretty sure this code worked before (data may be different, but still)

var a = new DateTime[] { DateTime.UtcNow, DateTime.UtcNow.AddDays(10) };
var b = a.Humanize(); // THROWS!

A collection formatter for the current culture has not been implemented yet.

I'm not sure what I'm looking into. any help is appreciated.

@MehdiK
Copy link
Member

MehdiK commented Mar 5, 2015

Thanks for reporting the issue. It must be related to #386. On reviewing I thought that PR was backward compatible; but apparently I was wrong. What's the current culture you're using?

@Bartmax
Copy link
Author

Bartmax commented Mar 5, 2015

is the culture set on spanish by chrome. In cultureInfo it prints ES as the culture. hope it helps. Let me know if you need to do something on my end. I'm more than happy to help.

@ghost
Copy link

ghost commented Mar 10, 2015

The problem with the collection formatter is the default implementation, which throws an exception. I had the same issue in German and Danish. This is why I came up with the generalization in my pull request.
My recommendation is using the "Regular Style" as default collection formatter, which seems the most common usage of concatenating list elements, and overwrite this for those languages which use the oxford style -or even something absolutely different.

I will create a pull request for that and the decision is up to MehdiK.

see: https://github.com/MehdiK/Humanizer/blob/master/src/Humanizer/Localisation/CollectionFormatters/DefaultCollectionFormatter.cs#L27

@MehdiK
Copy link
Member

MehdiK commented Mar 11, 2015

Thanks for the PR @ThomasMentzel. I like it. We left you a couple of comments on it.

I'm still wondering why it wasn't failing before and only it started failing after #386!!

MehdiK pushed a commit that referenced this issue Mar 28, 2015
…tes it in regular style with "&" as separator. in already implemented languages, it returns the language specific translation for "and". #392
@MehdiK
Copy link
Member

MehdiK commented Mar 29, 2015

This is now fixed by @ThomasMentzel and available on NuGet as v1.35.0. Thanks for reporting.

@hazzik
Copy link
Member

hazzik commented Apr 12, 2015

Meant to be closed

@hazzik hazzik closed this as completed Apr 12, 2015
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

3 participants