Posted: Thu Apr 10, 2008 9:17 am Post subject: Setting language environment 'export LANG'
Hello,
I need help on setting a custom Language environment when an application start. I can do through adding the following line in the beginning of a shell script in the Linux before starting the application. It works. Great.
example:
Code: (C)
1 2 3 4
export LANG=hi_IN.UTF-8
gedit
This will start Localized Hindi( Indian Language) version of the 'gedit', if the Hindi language pack and localized version of 'gedit' installed. But rest of the all applications and desktop will remain in English as my default language setting is English.
My Problem
In addition to GNOME desktop global language settings, I have a custom language setting in my application. Settings are saved in a configuration file. When the application start the application will read the language value from the configuration file and set the environment for that language. So that my localized version of the application will run in the specific language, but rest of them keep the desktops default language. At present , I am achieving this goal by modifying the value in the shell script in Linux and '.bat' file in Windows through my application.
My question is how to code to do 'export LANG=xxx' in C language without using shell script and use that environment when the program start. I don't want use 'VTE Terminal Widget'. I am trying to build the application using minimum GTK+ libraries that will run on both Windows and Linux.
I can see the point of important where you have included a chapter "Using GLib" in your book " Foundations of GTK+ Development". Thank you very much for your help.