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

Umlauts not supported #3

Open
gucki opened this issue Jun 30, 2015 · 2 comments
Open

Umlauts not supported #3

gucki opened this issue Jun 30, 2015 · 2 comments

Comments

@gucki
Copy link

gucki commented Jun 30, 2015

Is:

%w(Birnen Äpfel Zitronen).natural_sort
=> ["Birnen", "Zitronen", "Äpfel"]

Correct would be:

%w(Birnen Äpfel Zitronen).natural_sort
=> ["Äpfel", "Birnen", "Zitronen"]
@johnnyshields
Copy link
Owner

I imagine this affects any type of accent. I'd accept a PR for this if it is generic.

@MGPalmer
Copy link

This works if you have ActiveSupport:

%w(Birnen Äpfel Zitronen).sort do |a, b|
      NaturalSort.comparator(
        ActiveSupport::Inflector.transliterate(a),
        ActiveSupport::Inflector.transliterate(b)
      )
end

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