[gnome-calculator] Correctly sort currencies with respect to locale



commit d317116b9f0ec8dfa71f5aef608d3291bf0b630b
Author: Lubomír Sedlář <lubomir sedlar gmail com>
Date:   Sat Nov 8 19:32:40 2014 +0100

    Correctly sort currencies with respect to locale
    
    Sorting via strcmp leads to incorrect results in certain locales. Using
    proper collation ensures the order will be correct.

 src/unit.vala |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/unit.vala b/src/unit.vala
index 437b96b..ecef448 100644
--- a/src/unit.vala
+++ b/src/unit.vala
@@ -123,7 +123,7 @@ public class UnitManager : Object
 
         var currency_category = default_unit_manager.add_category ("currency", _("Currency"));
         var currencies = CurrencyManager.get_default ().get_currencies ();
-        currencies.sort ((a, b) => { return strcmp (a.display_name, b.display_name); });
+        currencies.sort ((a, b) => { return a.display_name.collate (b.display_name); });
         foreach (var currency in currencies)
         {
             /* Translators: result of currency conversion, %s is the symbol, %%s is the placeholder for 
amount, i.e.: USD100 */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]