Take the 2-minute tour ×

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 !!

share|improve this question
10.04? It is supported, but I would seriously upgrade to a better version. –  nerof61 Feb 22 '13 at 11:22
@nerof61 : this is a specific system with specific hardware. Not my desktop OS :) –  martin-mystere Feb 22 '13 at 11:53
add comment

1 Answer

up vote 6 down vote accepted

You probably want to check the value of the LANG environment variable:

user@host:~$ echo $LANG

You can then write a short script which picks an appropriate file based on the value of this:

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).

share|improve this answer
That will to the trick. Thanks ! –  martin-mystere Feb 22 '13 at 14:08
add comment

Your Answer


