5

I have Ubuntu 15.04 installed on my machine. Currently terminal error messages are not in English (actually they are in Russian).

For example,

$ mmmm
mmmm: команда не найдена

I want to see

$ mmmm
mmmmm: command was not found

Solution provided for this SO post does not work for me.

6
  • did you tryed to reconfigure locales? sudo dpkg-reconfigure locales May 13, 2015 at 13:37
  • 1
    Try in terminal: export LANG=C and check again the system messages May 13, 2015 at 13:39
  • @RomeoNinov after running your command I see the following on the screen: \u041a\u043e\u043c\u0430\u043d\u0434\u0430 'mmmm' \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u0430 May 13, 2015 at 13:48
  • @FranciscoTapia there is no effect... May 13, 2015 at 13:50
  • try export LC_ALL=C May 13, 2015 at 14:00

1 Answer 1

6

The SO Post was in the right direction, but there are several environment variables which can be tested by an application. I use this script for example to reliably set the locale for commands:

#!/bin/sh
# $Id: with-locale,v 1.6 2011/10/27 22:51:45 tom Exp $
unset LANG
unset LC_ALL
unset LC_CTYPE
unset LESSCHARSET
unset LANGUAGE

LANG=$1
LC_ALL=$1
GDM_LANG=$1

export LANG
export LC_ALL
export GDM_LANG
shift
exec "$@"

That is, having with-locale in my path, I might do

with-locale C mmmmmm

to verify that it has no hardcoded messages.

You can always check to see what variables apply to your environment by running the locale command.

One of the comments asked about dpkg-reconfigure locales. That is,

sudo dpkg-reconfigure locales

would provide you with the way to alter the default locale settings on the machine (see for example How do I fix my locale issue? on AskUbuntu). Your shell initialization could of course override those. Note that because there are several variables, they can be set inconsistently. The locale(7) manual page mentions a few of the possibilities, including the LANGUAGE variable which can be the source of problems because it overrides the POSIX standard variables.

1
  • 1
    In my case the language was set through the LANGUAGE variable: export LANGUAGE="en_US.UTF-8". The changing of other variables did not change terminal language. May 13, 2015 at 16:57

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