Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

i'm using ‘exif’ on a server (Debian GNU/Linux 6.0.6 (squeeze)) and unlike on my dev computer (Mac OS X through MacPort) it runs in french :

exif -h
Utilisation: exif [OPTION...] fichier
  -v, --version                      Display software version
  -i, --ids                          Montre les ID plutôt que les noms des marqueurs
  -t, --tag=marqueur                 Sélection du marqueur
      --ifd=IFD                      Sélection de l'IFD
  -l, --list-tags                    Liste tous les marqueurs EXIF
  -|, --show-mnote                   Show contents of tag MakerNote
      --remove                       Supprime le marqueur ou l'ifd
  -s, --show-description             Montre la description du marqueur
  -e, --extract-thumbnail            Extrait la vignette
  -r, --remove-thumbnail             Supprime la vignette
  -n, --insert-thumbnail=FICHIER     Insère le FICHIER comme vignette
      --no-fixup                     Do not fix existing tags in files
  -o, --output=FICHIER               Write data to FILE
      --set-value=STRING             Value of tag
  -c, --create-exif                  Create EXIF data if not existing
  -m, --machine-readable             Output in a machine-readable (tab delimited) format
  -w, --width=WIDTH                  Width of output
  -x, --xml-output                   Output in a XML format
  -d, --debug                        Show debugging messages

I check my /etc/default/locale and it was

LANG=fr_FR
LANGUAGE=fr_FR:fr

which I changed in

LANG=en_EN
LANGUAGE=en_EN:en

without any consequences. Any hint on how to force this machin to execute this software in english ? Because i need to have exif-data labels in english :)

Thanks !

share|improve this question

2 Answers 2

up vote 2 down vote accepted

The /etc/default/locale file sets uhm... "global" defaults. That means, these defaults are read by any "top-level" shell when it starts up, and is then inherited by processes it runs.

Long story short, this means such defaults are applied to:

  • All daemons (programs running in background) as they're started using shell scripts located in /etc/init.d.
  • Interactive shells you run in your login session.

So merely changing that file requires a reboot.

But, as the contents of that file is just a shell script that sets a bunch of the so-called "environment variables", to effect one particular program you just have to make that program see different contents of these variables.

The simlest way to achieve this is to just put their assignment before the program to run, that is, at your shell prompt you can do:

$ LANG=en exif -h

and see exif talking to you in English (the $ character here denotes a shell prompt -- do not type it).

The second way is to make all the programs in the current shell see the new contents of the variables; this is done via "exporting" them, as @clarkw showed: an exported variable and its contents is inherited by the environment of all the processes run from the shell, so the following also works:

$ export LANG=en
$ exif -h

or

$ LANG=en
$ export LANG
$ exif -h

These environment variables are described in the locale(1) manual page.

And the last tip: do not change the contents of /etc/default/locale by hand — use the Debian way to manage it: run

# dpkg-reconfigure locales

which will first ask you which locales to compile and install (you can skip this step) and then which one to pick as the default.

Update: here's a page on the Debian wiki dedicated to locales which pretty much explains everything needed including the environment variables.

share|improve this answer
    
This is the way to change languages on a debian-based distro. –  jeremiah Mar 25 '13 at 9:50
    
Thank you very much. Now my exif is in English :) I did the dpkg-reconfigure, in case is mistype vars in /etc/default/locale yesterday. –  Amo__ Mar 25 '13 at 10:28

export LANG=C LC_ALL=C LANGUAGE=en_US:en and then run exif -h.

share|improve this answer
    
Not very sure but it may be not necessary to set the LANGUAGE var. –  bzjywhjm Mar 25 '13 at 8:21
    
this is correct. As I understand it, LANGUAGE is a GNU-ism which actually has list semantics -- contrary to those other standard POSIX variables. Of those standard variables, LANG sets the default, LC_whatever override specifics, and LC_ALL might be used to trump them all for special purposes. –  kostix Mar 25 '13 at 10:20

Your Answer

 
discard

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.