Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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. – horIzoN 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
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

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.