Ask Your Question
1

How to set locale for console output

asked 2013-08-07 03:26:03 -0500

polarfish gravatar image

I want to have russian language system wide and english for console outputs. I've perform necessary settings via localectl set-locale. Now my situation is the next:

[user@host ~]$ localectl status
   System Locale: LANG=ru_RU.UTF-8
                  LC_MESSAGES=C
       VC Keymap: ru
      X11 Layout: us,ru
       X11 Model: pc105
     X11 Options: grp:alt_shift_toggle
[user@host ~]$ locale
LANG=ru_RU.utf8
LC_CTYPE="ru_RU.utf8"
LC_NUMERIC=ru_RU.utf8
LC_TIME=ru_RU.utf8
LC_COLLATE="ru_RU.utf8"
LC_MONETARY=ru_RU.utf8
LC_MESSAGES="ru_RU.utf8"
LC_PAPER=ru_RU.utf8
LC_NAME="ru_RU.utf8"
LC_ADDRESS="ru_RU.utf8"
LC_TELEPHONE="ru_RU.utf8"
LC_MEASUREMENT=ru_RU.utf8
LC_IDENTIFICATION="ru_RU.utf8"
LC_ALL=

Why locale and localectl show different values? How can I set LC_MESSAGES to get english output from console applications?

My system info: Fedora 19 x64 GNOME 3.8.2

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2013-08-07 03:37:36 -0500

none gravatar image

updated 2013-08-07 03:40:56 -0500

From man locale:

The locale utility shall write information about the current locale environment, or all public locales, to the standard output. For the purposes of this section, a public locale is one provided by the implementation that is accessible to the application.

This mean, that locale will show you locales set to your current shell, and localectl will show you system locales (setup for all system, not for you current user, and environment) (man localectl):

localectl may be used to query and change the system locale and keyboard layout settings.

If you want, that your app print in english, then run it as:

LC_MESSAGES=C ./myapp

or add LC_MESSAGES=C to your .bashrc.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-08-07 03:26:03 -0500

Seen: 4,094 times

Last updated: Aug 07 '13