System language does not change

Asked by AndreyPutilov

The problem appeared while solving this https://answers.launchpad.net/ubuntu/+question/127569 .
Suddenly the Gnome menus language became english, when it was set up to russian for a long time.
I`ve opened "Language support", and it warned me, that "language-support-input-ru" is missing. I agreeded to install, but this had no effect, and package was still missing. I tried to install it manually, but it did not work

andrey@andrey-PC:~$ sudo apt-get install language-support-input-ru
[sudo] password for andrey:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package language-support-input-ru is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package language-support-input-ru has no installation candidate

I completely removed all russian support, and then installed again. Now I have no warning, that something is missing. But I cannot change language to russian anyway. I open "Language support", move russian at the top. close dialog, open it again and see russian language at the bottom.

When I was installing russan language support, I saw warnings in the log, but I don`t know, where to find this log. The only log I`ve found in Synaptic is not detailed.
Here it is

Commit Log for Tue Oct 5 00:00:30 2010

Removed the following packages:
gimp-help-ru
gnome-user-guide-ru
language-pack-gnome-ru
language-pack-gnome-ru-base
language-pack-ru
language-pack-ru-base
language-support-writing-ru
openoffice.org-help-ru
openoffice.org-l10n-ru
openoffice.org-thesaurus-ru
thunderbird-locale-ru

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu language-selector Edit question
Assignee:
No assignee Edit question
Solved by:
Sam_
Solved:
Last query:
Last reply:
Revision history for this message
Nitesh Mistry (mistrynitesh) said :
#1

Install 'language-pack-ru' and 'language-support-ru' and try again?

Revision history for this message
Sam_ (and-sam) said :
#2

Andrey,
as aptitude suggested
<Please note that you should install language-support-ru to get full support for this language>

in the other question, did you install the metapackage?
language-support-ru

Revision history for this message
AndreyPutilov (anputilov) said :
#3

Yes
andrey@andrey-PC:~$ LANG=C aptitude show language-pack-ru
Package: language-pack-ru
State: installed
Automatically installed: yes
Version: 1:10.04+20100714
Priority: optional
Section: translations
Maintainer: Language pack maintainers <email address hidden>
Uncompressed Size: 36.9k
Depends: language-pack-ru-base (>= 1:10.04+20100714)
PreDepends: dpkg (>= 1.10.27ubuntu1)
Replaces: language-pack-gnome-ru (< 1:10.04+20100714),
          language-pack-gnome-ru-base (< 1:10.04+20100714), language-pack-kde-ru
          (< 1:10.04+20100714), language-pack-kde-ru-base (< 1:10.04+20100714),
          language-pack-ru (< 1:10.04+20100714), language-pack-ru-base
Description: translation updates for language Russian
 Translation data updates for all supported packages for: Russian

 language-pack-ru-base provides the bulk of translation data and is updated only
 seldom. This package provides frequent translation updates.

 Please note that you should install language-support-ru to get full support for
 this language.

And Language support applet provides no warning. But any time I run Language support applet, English is on the top, if I drag Russian there or not.

Revision history for this message
Sam_ (and-sam) said :
#4

Andrey,
'aptitude show' only shows information_about_the_package.
Installation goes e.g. via Synaptic, CLI (I don't prefer Software Center, my subjective)
CLI:
apt-get install language-support-ru

https://help.ubuntu.com/community/SynapticHowto
https://help.ubuntu.com/community/AptGet/Howto
https://help.ubuntu.com/community/SoftwareManagement

Revision history for this message
Sam_ (and-sam) said :
#5

Erratum:
Of course using 'sudo':
sudo apt-get install language-support-ru

Revision history for this message
AndreyPutilov (anputilov) said :
#6

ok
now I will remove all those packages, then install, and provide you with all the logs

andrey@andrey-PC:~$ sudo apt-get remove gimp-help-ru gnome-user-guide-ru language-pack-gnome-ru language-pack-gnome-ru-base language-pack-ru language-pack-ru-base language-support-writing-ru openoffice.org-help-ru openoffice.org-l10n-ru openoffice.org-thesaurus-ru thunderbird-locale-ru
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  gimp-help-ru gnome-user-guide-ru language-pack-gnome-ru
  language-pack-gnome-ru-base language-pack-ru language-pack-ru-base
  language-support-writing-ru openoffice.org-help-ru openoffice.org-l10n-ru
  openoffice.org-thesaurus-ru thunderbird-locale-ru
0 upgraded, 0 newly installed, 11 to remove and 0 not upgraded.
After this operation, 77,6MB disk space will be freed.
Do you want to continue [Y/n]? y
(Reading database ... 295245 files and directories currently installed.)
Removing gimp-help-ru ...
Removing gnome-user-guide-ru ...
Removing openoffice.org-thesaurus-ru ...
Removing language-support-writing-ru ...
Removing openoffice.org-help-ru ...
Removing openoffice.org-l10n-ru ...
Removing thunderbird-locale-ru ...
Removing language-pack-gnome-ru-base ...
Removing language-pack-gnome-ru ...
Removing language-pack-ru-base ...
Removing language-pack-ru ...
Processing triggers for doc-base ...
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
 LANGUAGE = "en",
 LC_ALL = (unset),
 LANG = "ru_RU.utf8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Processing 1 removed doc-base file(s)...
Registering documents with scrollkeeper...
Processing triggers for python-gmenu ...
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
Rebuilding /usr/share/applications/desktop.ru_RU.utf8.cache...
WARNING: System locale is invalid
Processing triggers for software-center ...
WARNING:root:setlocale failed with 'unsupported locale setting'
Processing triggers for python-support ...
Processing triggers for python-central ...

andrey@andrey-PC:~$ sudo apt-get install language-support-ru
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  language-support-writing-ru
Suggested packages:
  language-pack-ru
The following NEW packages will be installed:
  language-support-ru language-support-writing-ru
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 1938B/4024B of archives.
After this operation, 73.7kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://cz.archive.ubuntu.com/ubuntu/ lucid/main language-support-ru 1:10.04+20100311 [1938B]
Fetched 1938B in 0s (2913B/s)
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
 LANGUAGE = "en",
 LC_ALL = (unset),
 LANG = "ru_RU.utf8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
Selecting previously deselected package language-support-writing-ru.
(Reading database ... 293642 files and directories currently installed.)
Unpacking language-support-writing-ru (from .../language-support-writing-ru_1%3a10.04+20100311_all.deb) ...
Selecting previously deselected package language-support-ru.
Unpacking language-support-ru (from .../language-support-ru_1%3a10.04+20100311_all.deb) ...
Setting up language-support-writing-ru (1:10.04+20100311) ...
Generating locales...
  ru_RU.UTF-8... done
  ru_UA.UTF-8... done
Generation complete.

Processing triggers for python-gmenu ...
Rebuilding /usr/share/applications/desktop.ru_RU.utf8.cache...
Setting up language-support-ru (1:10.04+20100311) ...
Processing triggers for python-support ...

Revision history for this message
Sam_ (and-sam) said :
#7

> now I will remove all those packages

For what reason?

Revision history for this message
AndreyPutilov (anputilov) said :
#8

to see all the logs, to miss nothing.

Look.
I have a problem.
I don`t know, where to look for a solution.
I know, that all technical useful information is captured in logs. Then I produce such logs. The reason - to see the information that might be helpful. I don`t now where to look for such an information else.

Revision history for this message
Sam_ (and-sam) said :
#9

You had already installed all necessary packages except the language-support-ru.
There was no need to remove them, in contrary it could've made the situation worse as it may corrupt local environment.
When you install them again you should be fine.
Same procedure with system administration -> language support

Revision history for this message
AndreyPutilov (anputilov) said :
#10

You`ve seen logs "sudo apt-get install language-support-ru"...
It is installed. I open Language Support. No warning. I move russian language at the top. No result. English is still at the top every time I launch Language Support. What`s wrong?

Revision history for this message
Sam_ (and-sam) said :
#11

Yep, I've read the output as it said at the end:
Generating locales...
  ru_RU.UTF-8... done
  ru_UA.UTF-8... done
Generation complete.

Did you reinstall the *ru related packages which you've removed before?
And then reboot?

https://help.ubuntu.com/community/EnvironmentVariables

Revision history for this message
AndreyPutilov (anputilov) said :
#12

>>Did you reinstall the *ru related packages which you've removed before?
I hope all needed packages I have installed. I don`t know. I wrote all I`ve done. I think, if some package is missing, LanguageSupport will warn me. I still can not change the language. It couldn`t be a problem with misunderstanding of interface< The only thing I need to do is to drag russian language at the top and close the window? No "apply changes" button? I drag russian language at the top, but every time I launch LanguageSupport, english is at the top.

Revision history for this message
Nitesh Mistry (mistrynitesh) said :
#13

Andrey,
Can you please paste the output of the following command in terminal:

locale -a

Thank you for being patient while helping us help you solve the problem.

Revision history for this message
Nitesh Mistry (mistrynitesh) said :
#14

Meanwhile you can also try the following and tell us if it worked

At the bottom of the login screen, you might see a 'Language' option.
See if you can select your russian from there and then login.

Revision history for this message
AndreyPutilov (anputilov) said :
#15

I`ve said, in LanguageSupport I have english at the top. But at the bottom of login screen by default I see "Russian federation". Anyway loaded desktop is completely in english.

andrey@andrey-PC:~$ locale -a
C
cs_CZ.utf8
en_AG
en_AU.utf8
en_BW.utf8
en_CA.utf8
en_DK.utf8
en_GB.utf8
en_HK.utf8
en_IE.utf8
en_IN
en_NG
en_NZ.utf8
en_PH.utf8
en_SG.utf8
en_US.utf8
en_ZA.utf8
en_ZW.utf8
POSIX
ru_RU.utf8
ru_UA.utf8

Revision history for this message
Sam_ (and-sam) said :
#16

Please provide output:
cat /var/lib/locales/supported.d/local

Go to directory and list folders:
cd /var/lib/locales/supported.d
ls

Revision history for this message
AndreyPutilov (anputilov) said :
#17

andrey@andrey-PC:~$ cat /var/lib/locales/supported.d/local
en_US.UTF-8 UTF-8
ru_RU.UTF-8 UTF-8
ru_UA.UTF-8 UTF-8

andrey@andrey-PC:/var/lib/locales/supported.d$ ls
cs en local

Revision history for this message
Sam_ (and-sam) said :
#18

ru isn't on top.
Anyway, if you only need 'ru' delete the line en_.... and move other lines up.
Or move line en_... at the end.

Then run:
sudo dpkg-reconfigure locales

Revision history for this message
AndreyPutilov (anputilov) said :
#19

I`ve edited /var/lib/locales/supported.d/local ..all ran well

Then andrey@andrey-PC:~$ sudo dpkg-reconfigure locales
Generating locales...
  cs_CZ.UTF-8... done
  en_AG.UTF-8... done
  en_AU.UTF-8... done
  en_BW.UTF-8... done
  en_CA.UTF-8... done
  en_DK.UTF-8... done
  en_GB.UTF-8... done
  en_HK.UTF-8... done
  en_IE.UTF-8... done
  en_IN.UTF-8... done
  en_NG.UTF-8... done
  en_NZ.UTF-8... done
  en_PH.UTF-8... done
  en_SG.UTF-8... done
  en_US.UTF-8... done
  en_ZA.UTF-8... done
  en_ZW.UTF-8... done
  ru_RU.UTF-8... up-to-date
  ru_UA.UTF-8... up-to-date
Generation complete.

Then I restarted the system. At the bottom of login screen I saw "English (US)". I chosen "Russian (Russian Federation)" and did the log in. The system is in English.

I can provide those output again, now, after reboot

andrey@andrey-PC:~$ cat /var/lib/locales/supported.d/local
ru_RU.UTF-8 UTF-8
en_US.UTF-8 UTF-8
ru_UA.UTF-8 UTF-8
andrey@andrey-PC:/var/lib/locales/supported.d$ ls
cs en local

Revision history for this message
Sam_ (and-sam) said :
#20

Maybe try to move or rename 'local' completely then reconfigure again.
In case also test the workaround provided in bug report.

Revision history for this message
AndreyPutilov (anputilov) said :
#21

I renamed "local". No effect. But this is a system folder, not user`s. These settings are for all users? Maybe some problem with my own configuration? Where are my personal settings? In linked bug report one file is mentioned, something like .profile, but I found no such a file. I`ve found .dmrc.

andrey@andrey-PC:~$ cat .dmrc

[Desktop]
Session=gnome
Language=ru_RU.utf8
Layout=us

Then I think, if LanguageSupport is not working, maybe it provides any warnings to terminal? I didn`t know, how to launch this from terminal, but I`ve found a gnome-language-selector process.

andrey@andrey-PC:~$ gnome-language-selector
/usr/lib/python2.6/dist-packages/LanguageSelector/gtk/GtkLanguageSelector.py:802: GtkWarning: gtk_cell_view_set_cell_data: assertion `cell_view->priv->displayed_row != NULL' failed
  cell = combo.get_child().get_cell_renderers()[0]

<now the window is on the screen>

<I`ve moved Russian at the top - no more output>

<I`ve closed window - no more output>

Revision history for this message
Sam_ (and-sam) said :
#22

Here on Lucid is a ~/.profile (hidden file in /home/user).
Please note the mentioned link about environment variables.

Assigned the question to language-selector.
If the .profile trick doesn't help consider to report a bug.
https://bugs.launchpad.net/ubuntu/+source/language-selector

Revision history for this message
AndreyPutilov (anputilov) said :
#23

Look!
Here https://bugs.launchpad.net/ubuntu/+source/language-selector/+bug/584468
I have read
>Then I found out that everybody else was lacking .profile file, but not the one for whom the language change worked.
>Copied .profile file for rest and Finnish language was changed for them.

and my message, that
>In linked bug report one file is mentioned, something like .profile, but I found no such a file.

What deduction can I think of? I need a ~/.profile file. What it should contain? Where I can get it?

andrey@andrey-PC:~$ ls -la | grep profile
andrey@andrey-PC:~$

Revision history for this message
Best Sam_ (and-sam) said :
#24

This is the content of mine which is from 9.10 upgrade to 10.04 and unchanged since Oct 2nd 2009.
http://paste.ubuntu.com/518351/

Revision history for this message
AndreyPutilov (anputilov) said :
#25

Sorry but I can not log in with this file. I enter my password, and then I see the same login screen. I tried to login on terminal (tty1), and had such a message:

: command not found
: command not found
-bash: /home/andrey/.profile: line 24: syntax error: unexpected end of file

and the file has only 23 lines, there is no 24-th line. I tried to add or remove empty lines at the end, but this had no effect. The same error on non-existent line.

Revision history for this message
Sam_ (and-sam) said :
#26

Paste the file.

Revision history for this message
AndreyPutilov (anputilov) said :
#27
Revision history for this message
AndreyPutilov (anputilov) said :
#28

Launchpad added emty lines, but the file is the same as yours

andrey@andrey-PC:~$ cat .profile.bad
# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.

# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022

# if running bash
if [ -n "$BASH_VERSION" ]; then
    # include .bashrc if it exists
    if [ -f "$HOME/.bashrc" ]; then
 . "$HOME/.bashrc"
    fi
fi

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH"
fi

andrey@andrey-PC:~$

Revision history for this message
Sam_ (and-sam) said :
#29

Andrey,
I've uploaded the same file and got no empty lines.

The only syntax diff I get from the ouptut you've posted here is line #15:
$ diff -u test .profile
--- test 2010-10-25 19:42:16.095163320 +0200
+++ .profile 2009-10-02 13:08:58.555558531 +0200
@@ -12,7 +12,7 @@
 if [ -n "$BASH_VERSION" ]; then
     # include .bashrc if it exists
     if [ -f "$HOME/.bashrc" ]; then
- . "$HOME/.bashrc"
+ . "$HOME/.bashrc"
     fi
 fi

So I guess you're just making a copy&paste error.
Make sure after the last 'fi' isn't an extra line, so it ends on line #22, then put the cursor at the very beginning of the first line and save the file.

Revision history for this message
AndreyPutilov (anputilov) said :
#30

It is not funny, but I have no russian. I`ve rewrited the .profile file by hands and with no comments, and it works! I can log in! I opened LanguageSupport, moved "Russian" at the top, then "Russian (Russian Federation)", then "English". I close and open LanguageSupport, and the order is the same, Russian is at the top! But all menus and applications are in English. I cannot understand this. I did a restart twice, but no effect.

andrey@andrey-PC:~$ cat .dmrc

[Desktop]
Session=gnome
Language=ru_RU.utf8
Layout=us
andrey@andrey-PC:~$

Revision history for this message
AndreyPutilov (anputilov) said :
#31

andrey@andrey-PC:~$ cat /var/lib/locales/supported.d/local
ru_RU.UTF-8 UTF-8
en_US.UTF-8 UTF-8
ru_UA.UTF-8 UTF-8
andrey@andrey-PC:~$ ls /var/lib/locales/supported.d/
cs en local
andrey@andrey-PC:~$

Revision history for this message
Sam_ (and-sam) said :
#32

Did you test workaround mentioned in Bug 574540?

Revision history for this message
AndreyPutilov (anputilov) said :
#33

I am amazed of this system. I have plenty of features, files, places, directives, utilities, and I have to manipulate this all, and I can`t see any logic connections among this all. It is said, that women don`t have any logic. It is not true, phrase author`s didn`t see Ubuntu!

I`ve added the line
export LANGUAGE="ru_RU.utf8"
at the beginning of the .profile file. I didn`t restart the computer at once, because I was downloading some photos. Then I decided to take a look at the file. I was surprised, but the file was changed. Someone added the line
export LANGUAGE="ru:ru_RU:en"
at the end, though such line as "export LANGUAGE=..." was present twice. I commented that new, and retained my variation. I restarted, and saw all menus still in English. I`ve opened LanguageSupport, and I see... Surprise! At the top - Czech language (it is installed, but I don`t want it on my desktop). Then - English, Russian was below English. I moved list items back, and checked the .profile file. No line was added at the end of the file, but my line at the top was overwrote this way:

andrey@andrey-PC:~$ cat .profile
# ~/.profile: executed by the command interpreter for login shells.
# This file is read by bash...

export LANGUAGE="ru:ru_RU:en"

if [ -n "$BASH_VERSION" ]; then

 if [ -f "$HOME/.bashrc" ]; then
  . "$HOME/.bashrc"
 fi
fi

if [ -d "$HOME/bin" ]; then
 PATH="$HOME/bin:PATH"
fi
#export LANGUAGE="ru:ru_RU:en"
andrey@andrey-PC:~$

I restarted the computer once more, all menus are still in English.

Maybe if I knew Ubuntu or Gnome or Linux better, I would realise, what to write to these files, but I am not in IT, and for me this all does not do any logic.

Revision history for this message
Sam_ (and-sam) said :
#34

Obviously too less people reported or confirmed bugs about the issue (since May 2010 no progress), so I'd start to answer the questions of #1 in Bug 584468 and reopen it.

Take the .profile as is (orig.), then try pasting in very last line (line 23) after fi:
export LANG=ru_RU.utf8

Maybe also take a look in ~/.bashrc if there're any language entries which shouldn't be there.
https://help.ubuntu.com/community/EnvironmentVariables#Session-wide%20environment%20variables

Revision history for this message
AndreyPutilov (anputilov) said :
#35

Ok
I don`t have such files as ~/.bashrc, ~/.bash_profile, ~/.bash_login
Ok, I see, the bug is so dubious

Thank you very much, Sam
Simply I don`t know how to thank you, because you do such a big work)
Thank you once again

Because of all this now I am starting the upgrade up to 10.10

Revision history for this message
AndreyPutilov (anputilov) said :
#36

I only want to add, that upgrade to 10.10 did not help. I am surprised, but the only application in Russian is "Язык системы" (Language support)

Revision history for this message
Sam_ (and-sam) said :
#37

What a pity. To help making Ubuntu better consider to file a new bug, thanks.

I'd like to return regarding the topic:
<I`ve opened "Language support", and it warned me, that "language-support-input-ru" is missing.>

As we (and others) found out the package doesn't exist in 10.04 and 10.10
http://ubuntuforums.org/showpost.php?s=ce8079de3ea42975c24f07058b7c4fb6&p=9242307&postcount=9

So that_is another bug of language-selector advising to install a package which isn't there.

Revision history for this message
AndreyPutilov (anputilov) said :
#38
Revision history for this message
AndreyPutilov (anputilov) said :
#39

Now I have all interface is Russian.

It was silly. I went to Language Support -> install languages, and not all the checkboxes were marked. I marked all, and some new packages were installed, and after reboot all was ok. Anyway, we overcame two bugs, about wrong offer to install non-present package and about missing ~/.profile file.

Once again I want to thank you, Sam, and all others for such a large work on this theme

Revision history for this message
AndreyPutilov (anputilov) said :
#40

Thanks Sam, that solved my question.

Revision history for this message
Andrei Emeltchenko (andrei-emeltchenko-finik) said :
#41

Hi, I have similar problem, I have Russian support installed but the Russian language is not shown in "Languages for menu and windows" list. Russian option is not selectable (shown in gray color)

Revision history for this message
AndreyPutilov (anputilov) said :
#42

Maybe this is not a problem but a tool design misunderstanding. You should drag languages to the top, not to click them. Read the comment below "Drag languages to arrange them in order of preference. Changes take effect next time you log in"