How to do 'export LANG=en" Using C

Hi
Could you please help me How to program Linux shell commands using C. I want set Language environment before start a particular application.

Example:-

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 GNOME desktop will remain in English as my default language setting is English. This is what I want.

How can I program " export LANG=hi_IN.UTF-8 " using C language without going to shell prompt or without using shell script.

Please help

Ram Das

To set an environment variable from C, use putenv() or setenv()

As an aside, in the shell, if you only want to set or change the variable for one command but otherwise keep it as it is, the export is superfluous.

LANG=hi_IN.UTF-8 gedit

will start gedit with LANG set to that value without affecting its value in the current shell or other commands started from it.

Hello era,

Defenetly helpfull this "putenv() or setenv()" .

Thank you.
Ram Das