[chronojump] Languages sorted natively



commit ef3c4c2c9f9942cce4bcda8924358f8dfa3e01c4
Author: Xavier de Blas <xaviblas gmail com>
Date:   Thu Dec 10 11:48:27 2015 +0100

    Languages sorted natively

 src/gui/preferences.cs |    2 +-
 src/utilLanguage.cs    |    5 +++++
 2 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/src/gui/preferences.cs b/src/gui/preferences.cs
index 038da8d..c9c96cc 100644
--- a/src/gui/preferences.cs
+++ b/src/gui/preferences.cs
@@ -346,7 +346,7 @@ public class PreferencesWindow {
                langsStore = new ListStore(typeof(string), typeof(CultureInfo));
 
                foreach (CultureInfo lang in UtilLanguage.Languages) {
-                       langsStore.AppendValues(lang.DisplayName, lang);
+                       langsStore.AppendValues(lang.NativeName, lang);
                        if (preferences.language != "" && lang.Name == preferences.language)
                                active = index;
                        index ++;
diff --git a/src/utilLanguage.cs b/src/utilLanguage.cs
index e42698a..1b30c9a 100644
--- a/src/utilLanguage.cs
+++ b/src/utilLanguage.cs
@@ -53,6 +53,11 @@ public class UtilLanguage
                                        }
                                } 
                        }
+
+                       langs.Sort((p1, p2) => string.Compare(p1.NativeName, p2.NativeName, false));
+                       foreach(CultureInfo myLang in langs)
+                               LogB.Debug(myLang.NativeName);
+                       
                        return langs;
                }
        }


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