プロジェクト

全般

プロフィール

Vote #68253

未完了

Sort order doesn't treat german "umlaute" correct in user listing

Admin Redmine さんが3年以上前に追加. 3年以上前に更新.

ステータス:
Needs feedback
優先度:
通常
担当者:
-
カテゴリ:
I18n_37
開始日:
2010/09/28
期日:
進捗率:

0%

予定工数:
category_id:
37
version_id:
32
issue_org_id:
6523
author_id:
21087
assigned_to_id:
0
comments:
14
status_id:
10
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
21
ステータス-->[Needs feedback]

説明

Sorting of object seems to treat german special characters not correct.

Ä should range equal to ae, Ö should range equal to oe, Ü should range equal to ue and ß should range equal to ss.

Seems to be correct when user groups are listed, but broken when Users are listed (at least in groups), where ä,ö,ü and ß range behind z


journals

Well, any news on this? I tried this, but it seems to work on my system.

If there is no feedback on this issue, I'm going to close this next week.
--------------------------------------------------------------------------------
Sorry for being somewhat late ....

I'm somewhat overwhelmed with project work, so our redmine incarnation is not very up-to-date - means I'm at 1.3.1stable here.

I've checked on that anyhow, because it's way more current than the version the problem was reported for (1.0.1). The problem ist definitely there on V1.3.1.

I've opened a group's user list, and found the following sort order (names shortened ...)

<pre>
Fi...
Ge...
Gi...
Gl...
Go...
Gr...
Gä... (wrong position)
Gü... (wrong position)
Ha...
He...
Hi...
Ho...
Hä... (wrong position)
Ig...
</pre>

Could anybody from DE locale please check that with the current version ?
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
In v2.2 everything is fine.
--------------------------------------------------------------------------------
Filou Centrinov wrote:
> In v2.2 everything is fine.

Ruby 1.8 or 1.9?
--------------------------------------------------------------------------------
> Ruby 1.8 or 1.9?
ruby 1.9.1

Update: Only in the admin settings the group list is sorted correctly. When I want to add a group as a member to a project (in the project settings) the list is not correct!

Hint: In the german language the sorting of ä is equal to a. (ö=o, ü=u)
--------------------------------------------------------------------------------
Any news on this issue?

Any idea how to fix this problem? Which coalition is used in the database table?

Maybe this could be a 2.4 goal.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
This problem is somehow "unfixable", as there is no silver bullet.

By choosing one collation, you will "fix" it for one language, but break it for another one, because that's what collations are made for, to solve the problem of ordering characters.

Maybe the best sollution could be to high awareness of collations and help new users figure out what is the correct one they should use to support their languages.

Here are some documentations that could give more info on the problem:
* http://dev.mysql.com/doc/refman/5.5/en/charset-charsets.html
* http://dev.mysql.com/doc/refman/5.5/en/charset-unicode-sets.html
* http://www.unicode.org/charts/uca/
--------------------------------------------------------------------------------
And a plus about the problem specific:
* http://stackoverflow.com/questions/5526169/what-is-the-best-mysql-collation-for-german-language
* http://stackoverflow.com/questions/2344118/utf-8-general-bin-unicode
* http://dev.mysql.com/doc/refman/5.5/en/charset-collation-effect.html

(sorry, had to split it in two answers as redmine "flaged" as a possible spam)
--------------------------------------------------------------------------------
Gabriel Mazetto wrote:
> This problem is somehow "unfixable", as there is no silver bullet.
>
> By choosing one collation, you will "fix" it for one language, but break it for another one, because that's what collations are made for, to solve the problem of ordering characters.

Redmine/Rails could handle ORDER BY .. COLLATE part depending on user profile?

--------------------------------------------------------------------------------
The problem seems to be more with ruby #sort:

Using the database sort (MySQL):

<pre>
irb(main):002:0> Group.sorted.all.map(&:name)
←[1m←[35mGroup Load (0.0ms)←[0m SELECT `users`.* FROM `users` WHERE `users`.`
type` IN ('Group') ORDER BY users.lastname ASC
=> ["Gä", "Gr", "Gü"]
</pre>

Using ruby #sort (1.9.3):

<pre>
irb(main):003:0> Group.all.map(&:name).sort
←[1m←[36mGroup Load (0.0ms)←[0m ←[1mSELECT `users`.* FROM `users` WHERE `user
s`.`type` IN ('Group')←[0m
=> ["Gr", "Gä", "Gü"]
</pre>

Filou Centrinov wrote:

> Update: Only in the admin settings the group list is sorted correctly.

Because it uses a SQL ORDER

> When I want to add a group as a member to a project (in the project settings) the list is not correct!

In 2.2, groups are sorted using ruby #sort for when adding a project member. Since 2.3, it uses a SQL ORDER statement so it should be OK now.
--------------------------------------------------------------------------------
2.4 feature freeze
--------------------------------------------------------------------------------
I had the same problem on edit/add issue page and https://github.com/twitter/twitter-cldr-rb#sorting-collation help me.
I added this twitter_cldr gem to Gemfile.local and modify

app/helpers/application_helper.rb

<pre>
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -392,7 +392,10 @@ module ApplicationHelper
s << content_tag('option', "<< #{l(:label_author)} >>", :value => author.id)
end
groups = ''
- collection.sort.each do |element|
+ lang = TwitterCldr.supported_locale?(current_language) ? current_language : :en
+ collator = TwitterCldr::Collation::Collator.new(lang)
+ collection.sort do |a, b|
+ collator.compare(a.name, b.name)
+ end.each do |element|
selected_attribute = ' selected="selected"' if option_value_selected?(element, selected) || element.id.to_s == selected
(element.is_a?(Group) ? groups : s) << %(<option value="#{element.id}"#{selected_attribute}>#{h element.name}</option>)
end
</pre>
--------------------------------------------------------------------------------

Admin Redmine さんが3年以上前に更新

  • カテゴリI18n_37 にセット
  • 対象バージョンCandidate for next major release_32 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0