Search code examples
linuxlocalizationlinux-mint

LC_MESSAGES has no effect


Setting up LC_MESSAGES changes messages (in my case) from russia to english.

$ env | grep UTF
LC_MESSAGES=en_US.UTF-8
LANG=ru_UA.UTF-8

$ git status .
On branch master
Your branch is ahead of 'origin/master' by 11 commits.
  (use "git push" to publish your local commits)

nothing to commit, working directory clean

Everythings seems OK, but connecting to this host via ssh. Make messages back to russia despite on variable LC_MESSAGES. Look:

$ ssh user@localhost
$ env | grep UTF
LC_MESSAGES=en_US.UTF-8
LANG=ru_UA.UTF-8
$ git status .
В ветке master
Your branch is ahead of 'origin/master' by 11 commits.
  (use "git push" to publish your local commits)

нечего фиксировать, рабочая директория пуста

How to leave interface in russia but force messages to be in english?

$ uname -a Linux KES-PC 3.13.0-37-generic #64-Ubuntu SMP Mon Sep 22 21:28:38 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux


Solution

  • As @thatotherguy noted, I must use locale to see what is coming on.

    in first case:

    $locale
    LANG=ru_UA.UTF-8
    LANGUAGE=
    LC_CTYPE="ru_UA.UTF-8"
    LC_NUMERIC="ru_UA.UTF-8"
    LC_TIME="ru_UA.UTF-8"
    LC_COLLATE="ru_UA.UTF-8"
    LC_MONETARY="ru_UA.UTF-8"
    LC_MESSAGES=en_US.UTF-8
    LC_PAPER="ru_UA.UTF-8"
    LC_NAME="ru_UA.UTF-8"
    LC_ADDRESS="ru_UA.UTF-8"
    LC_TELEPHONE="ru_UA.UTF-8"
    LC_MEASUREMENT="ru_UA.UTF-8"
    LC_IDENTIFICATION="ru_UA.UTF-8"
    LC_ALL=
    

    after ssh

    $ssh user@localhost
    $locale
    LANG=ru_UA.UTF-8
    LANGUAGE=ru_UA:ru
    LC_CTYPE="ru_UA.UTF-8"
    LC_NUMERIC="ru_UA.UTF-8"
    LC_TIME="ru_UA.UTF-8"
    LC_COLLATE="ru_UA.UTF-8"
    LC_MONETARY="ru_UA.UTF-8"
    LC_MESSAGES=en_US.UTF-8
    LC_PAPER="ru_UA.UTF-8"
    LC_NAME="ru_UA.UTF-8"
    LC_ADDRESS="ru_UA.UTF-8"
    LC_TELEPHONE="ru_UA.UTF-8"
    LC_MEASUREMENT="ru_UA.UTF-8"
    LC_IDENTIFICATION="ru_UA.UTF-8"
    LC_ALL=
    

    The difference is LANGUAGE. googling help. That variable are setted up in /etc/defaults/locale

    $ cat /etc/default/locale
    LANG="ru_UA.UTF-8"
    LANGUAGE="ru_UA:ru"
    

    So I add to my .bashrc

    export LANGUAGE=en
    

    But now I do not understand:

    1. I have LANGUAGE are setted up at /etc/defautls/locale. Why in first case its value empty string?
    2. Why LANGUAGE priority does not work? If I set LANGUAGE=en:ru or LANGUAGE=ru:en I have russian messages in both cases.