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?

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
  • Ok but why setting "LANG" variable DOES work WITHOUT export? – MulliGun Aug 18 '15 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. – Tilman Schmidt Aug 18 '15 at 11:37

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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