[Answered ]-How to show sorted list by overall completion in Pootle

2👍

Change

items.sort(lambda x, y: locale.strcoll(x['name'], y['name']))

to

items.sort(lambda x, y: cmp(x['transper'], y['transper']))

(This works well with the builtin cmp function because the transper fields are converted to ints by the nice_percentage function, which is called as part of add_percentages)

If that doesn’t produce the order you wanted, simply switch objects x and y.


If instead you need to sort it in the template (it’s typically a bad idea to mess with third-party apps’ source code), you can use the dictsort filter:

{% for item in languages|dictsort:"transper" %}

Again, if that’s not the order you wanted, use dictsortreversed.

0👍

The latest development version of Pootle, to become Pootle 2.2, now remembers which column you have selected to sort on. So a page reload will now remember the order you last used.

👤Dwayne

Leave a comment