enable proxy support
[fanfix.git] / src / be / nikiroo / fanfix / Instance.java
index b4af5e836598bdce5a5bc6d0b04b1b8297bf6aff..a6f6fb75125404225cf8eed459f48d7cca282294 100644 (file)
@@ -17,6 +17,7 @@ import be.nikiroo.fanfix.library.LocalLibrary;
 import be.nikiroo.fanfix.library.RemoteLibrary;
 import be.nikiroo.utils.Cache;
 import be.nikiroo.utils.IOUtils;
+import be.nikiroo.utils.Proxy;
 import be.nikiroo.utils.TempFiles;
 import be.nikiroo.utils.TraceHandler;
 import be.nikiroo.utils.resources.Bundles;
@@ -52,6 +53,9 @@ public class Instance {
 
                // Most of the rest is dependent upon this:
                createConfigs(configDir, false);
+               
+               // Proxy support
+               Proxy.use(Instance.getConfig().getString(Config.USE_PROXY));
 
                // update tracer:
                boolean debug = Instance.getConfig()
@@ -545,8 +549,11 @@ public class Instance {
        private static String getLang() {
                String lang = config.getString(Config.LANG);
 
-               if (System.getenv("LANG") != null && !System.getenv("LANG").isEmpty()) {
-                       lang = System.getenv("LANG");
+               if (lang == null | lang.isEmpty()) {
+                       if (System.getenv("LANG") != null
+                                       && !System.getenv("LANG").isEmpty()) {
+                               lang = System.getenv("LANG");
+                       }
                }
 
                if (lang != null && lang.isEmpty()) {