I need to provide to my users a localized text file that would open (from a desktop icon) in the language that gnome is running. How I do that ?
I am running Lucid Ubuntu
Thanks !!
I need to provide to my users a localized text file that would open (from a desktop icon) in the language that gnome is running. How I do that ?
I am running Lucid Ubuntu
Thanks !!
You probably want to check the value of the LANG
environment variable:
user@host:~$ echo $LANG
en_GB.UTF-8
You can then write a short script which picks an appropriate file based on the value of this:
#!/bin/bash
SHORTLANG=${LANG:0:2}
zenity --text-info --filename greeting_${SHORTLANG}.txt
Which takes the first two characters of $LANG
and displays the appropriate textfile - greeting_en.txt
etc.
Finally, create a desktop link to this script.
(Adjust the length of the SHORTLANG
string if you're interested in the difference between en_GB
and en_US
rather than just the difference between fr
and de
).