Sitata / i18n_language_select

I18n Language Code Select Form Helper for Rails 3 & 4
https://github.com/Sitata/i18n_language_select
MIT License
0 stars 1 forks source link

sorting problem #3

Open pejuko opened 9 years ago

pejuko commented 9 years ago

With :cs locale is 'čeština' at the end of list (after z) should be after 'cebuánština'

astjohn commented 9 years ago

This is a tricky proposition. There's a good discussion on the topic at stackoverflow.

Have any ideas in mind?

pejuko commented 9 years ago

I would use the transliteration method and compare those ascii representatives. It does not give best results but it does not dependent on any native library. (btw. this method is used also by google when sorting language names for translation, it does not give always correct result but it is better than have them at the end of list). I have just discoverd that i18n supports transliteration and is customizable. See https://bibwild.wordpress.com/2014/06/26/ascii-ization-transliteration-built-into-ruby-i18n-gem-in-rails/ and http://apidock.com/rails/ActiveSupport/Inflector/transliterate