[chronojump] Fixed forcing languages like pt_BR



commit 229973376e870e329921c6deda6a59b1323361ec
Author: Xavier de Blas <xaviblas gmail com>
Date:   Thu Apr 26 16:08:28 2018 +0200

    Fixed forcing languages like pt_BR

 src/chronojump.cs   |    4 ++++
 src/utilLanguage.cs |    2 ++
 2 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/src/chronojump.cs b/src/chronojump.cs
index 64c5717..a96ceae 100644
--- a/src/chronojump.cs
+++ b/src/chronojump.cs
@@ -185,6 +185,10 @@ public class ChronoJump
                        Sqlite.DisConnect();
        
                        if(language != "") {
+                               //convert pt-BR to pt_BR
+                               if(language.Contains("-"))
+                                       language = language.Replace("-", "_");
+
                                Environment.SetEnvironmentVariable ("LANGUAGE", language); //works
 #if OSTYPE_WINDOWS
                                g_setenv ("LANGUAGE", language, true);
diff --git a/src/utilLanguage.cs b/src/utilLanguage.cs
index 610df70..e899a75 100644
--- a/src/utilLanguage.cs
+++ b/src/utilLanguage.cs
@@ -47,6 +47,8 @@ public class UtilLanguage
                                if (File.Exists (Path.Combine (dirpath, "LC_MESSAGES", filename))) {
                                        try {
                                                string localeName = Path.GetFileName(dirpath).Replace("_", 
"-");
+                                               //pt_BR will be pt-BR. This is needed to have them on the 
list at gui/preferences
+
                                                langs.Add(new CultureInfo (localeName));
                                        } catch (Exception ex) {
                                                LogB.Warning (ex.ToString());


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