[chronojump] Implementing language change (WIP)



commit 9482ba623719a8e0d44fb4a18866de377f498e9d
Author: Xavier de Blas <xaviblas gmail com>
Date:   Thu Jul 23 16:30:13 2015 +0200

    Implementing language change (WIP)

 src/chronojump.cs |   19 ++++++++++++++-----
 1 files changed, 14 insertions(+), 5 deletions(-)
---
diff --git a/src/chronojump.cs b/src/chronojump.cs
index 88c54d1..c48b111 100644
--- a/src/chronojump.cs
+++ b/src/chronojump.cs
@@ -53,7 +53,11 @@ public class ChronoJump
        bool updatingDB = false;
        private static string baseDirectory;
 
-
+
+#if OSTYPE_WINDOWS
+       [DllImport("libglib-2.0-0.dll") /* willfully unmapped */ ]
+       static extern bool g_setenv (String env, String val, bool overwrite);
+#endif
        public static void Main(string [] args) 
        {/*
                bool timeLogPassedOk = Log.Start(args);
@@ -65,7 +69,6 @@ public class ChronoJump
                //1.4.10
                Log.Start();
                LogB.Debugging = true; //now LogB.Debug will be shown. Also there will be thread info on 
Warning, Error, Information
-       
 
                var envPath = Environment.GetEnvironmentVariable ("PATH");
                var rBinPath = "";
@@ -140,10 +143,16 @@ public class ChronoJump
                        Environment.Exit(1);
                }
 
+//string language = "es_ES";   //works
+//string language = "es";      //works
+string language = "cs";
+Environment.SetEnvironmentVariable ("LANGUAGE", language); //works
+#if OSTYPE_WINDOWS
+g_setenv ("LANGUAGE", language, true);
+#endif
+
+Catalog.Init("chronojump",System.IO.Path.Combine(Util.GetPrefixDir(),"share/locale"));
 
-               Catalog.Init("chronojump",System.IO.Path.Combine(Util.GetPrefixDir(),"share/locale"));
-                                       
-                       
                new ChronoJump(args);
                
        }


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