1

I would like to change LC_MESSAGES locale var for current session like so:

LC_MESSAGES="fr_FR.utf8"

but it seems to not work:

user@debian:~$ cat w1.txt 
cat: w1.txt: Brak dostępu
user@debian:~$ LC_MESSAGES="fr_FR.utf8"
user@debian:~$ cat w1.txt 
cat: w1.txt: Brak dostępu # no change!

When i do it "per program": LC_MESSAGES="fr_FR.utf8" cat w1.txt it works:

cat: w1.txt: Permission non accordée

Shouldn't change made in the current session (LC_MESSAGES="fr_FR.utf8") be taken into account when running cat command?

1 Answer 1

0

You need to export environment variables in order for them to apply to programs you start:

ts@xenon:~> cat doesnotexist.txt
cat: doesnotexist.txt: Datei oder Verzeichnis nicht gefunden
ts@xenon:~> export LC_MESSAGES="fr_FR.utf8"
ts@xenon:~> cat doesnotexist.txt
cat: doesnotexist.txt: Aucun fichier ou dossier de ce type
2
  • Ok but why setting "LANG" variable DOES work WITHOUT export?
    – MulliGun
    Aug 18, 2015 at 11:04
  • It doesn't. It may just appear so to you because LANG is already exported somewhere in your profile. Try undoing that with unset LANG and re-test. Aug 18, 2015 at 11:37

You must log in to answer this question.

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