5

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

2
  • 10.04? It is supported, but I would seriously upgrade to a better version.
    – horIzoN
    Feb 22, 2013 at 11:22
  • 1
    @nerof61 : this is a specific system with specific hardware. Not my desktop OS :) Feb 22, 2013 at 11:53

1 Answer 1

6

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

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .