]> sjero.net Git - linphone/blobdiff - gtk/support.c
Aac-eld add missing header according to RFC3640 3.3.6
[linphone] / gtk / support.c
index 2124d2ee8deda69c1b565aae1d146fe8659845f6..de6c3a910b5eba48691404259bf9e61cc600985e 100644 (file)
@@ -156,7 +156,11 @@ const char *linphone_gtk_get_lang(const char *config_file){
 void linphone_gtk_set_lang(const char *code){
        LpConfig *cfg=linphone_core_get_config(linphone_gtk_get_core());
        const char *curlang;
-       curlang=getenv("LANG");
+       #if defined(WIN32) || defined(__APPLE__)
+               curlang=getenv("LANG");
+       #else
+               curlang=getenv("LANGUAGE");
+       #endif
        if (curlang!=NULL && strncmp(curlang,code,2)==0) {
                /* do not loose the _territory@encoding part*/
                return;
@@ -166,8 +170,10 @@ void linphone_gtk_set_lang(const char *code){
        char tmp[128];
        snprintf(tmp,sizeof(tmp),"LANG=%s",code);
        _putenv(tmp);
-#else
+#elif __APPLE__
        setenv("LANG",code,1);
+#else 
+       setenv("LANGUAGE",code,1);
 #endif
 }
 
@@ -192,6 +198,10 @@ void linphone_gtk_set_ui_config_int(const char *key , int val){
        lp_config_set_int(cfg,"GtkUi",key,val);
 }
 
+void linphone_gtk_set_ui_config(const char *key , const char * val){
+       LpConfig *cfg=linphone_core_get_config(linphone_gtk_get_core());
+       lp_config_set_string(cfg,"GtkUi",key,val);
+}
 
 static void parse_item(const char *item, const char *window_name, GtkWidget *w,  gboolean show){
        char tmp[64];