After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 753579 - The order of the language in a persons page is not intuitive
The order of the language in a persons page is not intuitive
Status: RESOLVED FIXED
Product: damned-lies
Classification: Infrastructure
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: damned-lies Maintainer(s)
damned-lies Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2015-08-13 09:35 UTC by gregoire
Modified: 2015-08-15 09:15 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to make the order of the list of languages case insensitive in a user's page (5.61 KB, patch)
2015-08-13 09:36 UTC, gregoire
none Details | Review
Make the order of the list of languages case insensitive in a user's page (5.61 KB, patch)
2015-08-13 09:36 UTC, gregoire
none Details | Review
Fix language order (corrected) (7.35 KB, patch)
2015-08-14 08:54 UTC, gregoire
none Details | Review

Description gregoire 2015-08-13 09:35:14 UTC
The select input sorts capitalized languages before un-capitalized so French and Spanish are after Tunkish.
Comment 1 gregoire 2015-08-13 09:36:18 UTC
Created attachment 309194 [details] [review]
Patch to make the order of the list of languages case insensitive in a user's page

This adds a new util function lc_sorted which is a localized version
of the built-in sorted function (using pyicu).
Comment 2 gregoire 2015-08-13 09:36:29 UTC
Created attachment 309195 [details] [review]
Make the order of the list of languages case insensitive in a user's page

This adds a new util function lc_sorted which is a localized version
of the built-in sorted function (using pyicu).
Comment 3 Claude Paroz 2015-08-13 18:35:22 UTC
Review of attachment 309195 [details] [review]:

::: common/utils.py
@@ +49,3 @@
         l.translated_name = _(getattr(l, tr_field))
     templist = [(obj_.translated_name.lower(), obj_) for obj_ in lst]
+    templist = sorted(templist, key=operator.itemgetter(0))

Is it wanted to use sorted here instead of lc_sorted?
Comment 4 Claude Paroz 2015-08-13 18:35:29 UTC
Review of attachment 309195 [details] [review]:

::: common/utils.py
@@ +49,3 @@
         l.translated_name = _(getattr(l, tr_field))
     templist = [(obj_.translated_name.lower(), obj_) for obj_ in lst]
+    templist = sorted(templist, key=operator.itemgetter(0))

Is it wanted to use sorted here instead of lc_sorted?
Comment 5 gregoire 2015-08-13 22:17:26 UTC
(In reply to Claude Paroz from comment #4)
> Review of attachment 309195 [details] [review] [review]:
> 
> ::: common/utils.py
> @@ +49,3 @@
>          l.translated_name = _(getattr(l, tr_field))
>      templist = [(obj_.translated_name.lower(), obj_) for obj_ in lst]
> +    templist = sorted(templist, key=operator.itemgetter(0))
> 
> Is it wanted to use sorted here instead of lc_sorted?

Hum, probably not :-/
Comment 6 gregoire 2015-08-14 08:54:53 UTC
Created attachment 309246 [details] [review]
Fix language order (corrected)

trans_sort_object_list is now correctly refactored to use the new function.

This also adds a new dependency to the mock package, but only for the
test suite (the mock package is included in the standard library in
later versions of python but not yet in 2.X).
Comment 7 Claude Paroz 2015-08-15 09:15:30 UTC
Thanks, patch slightly amended and pushed in https://git.gnome.org/browse/damned-lies/commit/?id=c1ff657e0dec62fc58cc6bb5872b7e2188908d69