Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
JA language system prompts within Konsole and xfce4 [Solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
dufeu
l33t
l33t


Joined: 30 Aug 2002
Posts: 897
Location: US-FL-EST

PostPosted: Thu Dec 22, 2016 1:18 pm    Post subject: JA language system prompts within Konsole and xfce4 [Solved] Reply with quote

Many years ago, in an attempt to start learning kanji, I had set up 'locale' and LINGUAS to support not only 'en' but also 'ja' {as per documentation of the time}. This included packages for different input methods etc.

When the behavior of L10N and LINGUAS was changed, I had a fair number of packages suddenly giving me dialog prompts in Japanese rather than continuing to default to English.

I updated 'locale' to be 'en' only and I changed my 'L10N' and 'LINGUAS' environment variables to be 'en' only as well. I performed a global package update and all packages such as 'aegisub' now prompt me in English as expected.

There is still one place I'm being given Japanese prompts and I haven't been able to determine why.

If I open a terminal window {tested with both xfce4 xterm and konsole} and issue the 'su -' command, I get prompted for password in Japanese:
Code:
パスワード:

If I switch {ctl-alt-F2} to a different tty, login {CLI} as the same user and then issue the 'su -' command, I get prompted for password in English {works as expected}:
Code:
password:

emerge --info | grep L10N gives me:
Code:
... L10N="en en-US" LINGUAS="en" ...

grep -R L10N /etc/portage/* gives me:
Code:
/etc/portage/make.conf:#   L10N options
/etc/portage/make.conf:# L10N="en"
/etc/portage/make.conf:L10N="en en-US"
/etc/portage/make.conf:# L10N="en en-US ja"

grep -R LINGUAS /etc/portage/* gives me:
Code:
/etc/portage/make.conf:#   LINGUAS options
/etc/portage/make.conf:LINGUAS="en"
/etc/portage/make.conf:# LINGUAS="en ja"

/etc/locale.gen is:
Code:
...
# For United States English
en_US ISO-8859-1
en_US.UTF-8 UTF-8

# For Japanese
# ja_JP EUC-JP#
# ja_JP.EUC-JP EUC-JP
# ja_JP.UTF-8 UTF-8

# For Chinese
# zh_CN.GB18030 GB18030
# zh_CN.GBK GBK
# zh_CN.UTF-8 UTF-8
# zh_CN GB2312

# For Korean
# ko_KR EUC-KR
# ko_KR.EUC-KR EUC-KR
# ko_KR.UTF-8 UTF-8

After performing an 'emerge -uD @world' and a 'locale-gen', everything should now and appears to be switched to using English as the only language.

In addition to the above global update, I've also explicitly re-emerged several packages include app-admin/sudo, pam-base/*, etc and several of their dependencies with special attention paid to any package which has 'L10N=' or 'LINGUAS='. Also I've gone through a number of global updates as well notably including updating KDE several times {currently 16.12.0, kde5, plasma5 or however versioning is now determined}.

In KDE Settings ==> Regional Settings ==> Language and also Formats, I'm configured only for American English

If I switch {ctl-alt-F2} to a different tty, login as a different {test} user, start either KDE or xfce4, open a terminal window and then issue the 'su -' command, I get prompted for password in English {works as expected}:
Code:
password:

Obviously, there must be some other setting for my problem {main} user somewhere that I'm not aware of.

I have looked in:
Code:
 ~/.bashrc
 ~/.bash_profile
 ~/.kde4/share/apps/konsole/Shell.profile
 ~/.local/share/konsole/Shell.profile
 ~/.config/konsolerc
but haven't seen anything which might account for this behavior.

If someone could point me at the right place, I'd very much appreciate it.

This is not something which is critical since this is only occurs on my main user account and just for when I execute 'su{do}' from a terminal. Everything else seems to work as expected and this is some kind of historical artifact.

Unfortunately, it doesn't seem to be covered by any of the documentation I've read or googling I've done.
_________________
People whom think M$ is mediocre, don't know the half of it.


Last edited by dufeu on Fri Dec 23, 2016 3:09 am; edited 1 time in total
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6228
Location: Room 101

PostPosted: Thu Dec 22, 2016 1:45 pm    Post subject: Reply with quote

dufeu ...

I would look in /etc/env.d/02locale ... and the output of 'locale -a' and 'locale' (for the problem account). You might also check the output of the following:

Code:
# eix '-Ie#' --installed-with-use locale_ja
# eix '-Ie#' --installed-with-use l10n_ja

I don't think the issue is the fact that you have 'ja' enabled, it has to be something in the env.

HTH & best ... khay
Back to top
View user's profile Send private message
dufeu
l33t
l33t


Joined: 30 Aug 2002
Posts: 897
Location: US-FL-EST

PostPosted: Thu Dec 22, 2016 7:32 pm    Post subject: Reply with quote

khayyam wrote:
... look in /etc/env.d/02locale ... and the output of 'locale -a' and 'locale' (for the problem account). You might also check the output of the following:

Code:
# eix '-Ie#' --installed-with-use locale_ja
# eix '-Ie#' --installed-with-use l10n_ja
...

Unfortunately, no joy:
Code:
pyrogyro ~ # locale -a
C
POSIX
en_US
en_US.iso88591
en_US.utf8

Code:
pyrogyro ~ # locale
LANG=en_US.utf8
LC_CTYPE="en_US.utf8"
LC_NUMERIC="en_US.utf8"
LC_TIME="en_US.utf8"
LC_COLLATE=C
LC_MONETARY="en_US.utf8"
LC_MESSAGES="en_US.utf8"
LC_PAPER="en_US.utf8"
LC_NAME="en_US.utf8"
LC_ADDRESS="en_US.utf8"
LC_TELEPHONE="en_US.utf8"
LC_MEASUREMENT="en_US.utf8"
LC_IDENTIFICATION="en_US.utf8"
LC_ALL=

Code:
pyrogyro ~ # eix '-Ie#' --installed-with-use locale_ja

Code:
pyrogyro ~ # eix '-Ie#' --installed-with-use l10n_ja

Code:
pyrogyro ~ # cat /etc/env.d/02locale
LANG="en_US.utf8"
LC_COLLATE="C"

{laughs} I still have this one stupid case where the language isn't working as expected.

It could be some per user env variable associated with pam or sudo, but darned if I can find it!

BTW - Thank you especially for this:
Code:
locale_ja
l10n_ja

I had been trying to figure out the same information using 'equery' and I couldn't figure out where to confirm the L10N and LINGUAS expanded USE equivalents. I keep forgetting 'eix' also has this functionality.
_________________
People whom think M$ is mediocre, don't know the half of it.
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6228
Location: Room 101

PostPosted: Thu Dec 22, 2016 8:22 pm    Post subject: Reply with quote

defeu ...

do you have anything in /etc/security/pam_env.conf? ... this will effect both sudo and su as 'pam_env' is used for 'auth', and 'session'.

grep pam_env /etc/pam.d/*:
/etc/pam.d/su:session    required     pam_env.so
/etc/pam.d/system-auth:auth      required   pam_env.so
/etc/pam.d/system-auth:session      required   pam_env.so
/etc/pam.d/system-login:session      required   pam_env.so
/etc/pam.d/system-services:session      required   pam_env.so

That's the only thing that comes to mind right now.

best ... khay
Back to top
View user's profile Send private message
dufeu
l33t
l33t


Joined: 30 Aug 2002
Posts: 897
Location: US-FL-EST

PostPosted: Thu Dec 22, 2016 9:26 pm    Post subject: Reply with quote

khayyam wrote:
... anything in /etc/security/pam_env.conf? ... this will effect both sudo and su as 'pam_env' is used for 'auth', and 'session'.

File /etc/security/pam_env.conf exists but consists solely of comments lines. It's basically the example file of what's available/possible settings.

Quote:
grep pam_env /etc/pam.d/*:
/etc/pam.d/su:session    required     pam_env.so
/etc/pam.d/system-auth:auth      required   pam_env.so
/etc/pam.d/system-auth:session      required   pam_env.so
/etc/pam.d/system-login:session      required   pam_env.so
/etc/pam.d/system-services:session      required   pam_env.so

...

grep pam_env /etc/pam.d/*:
/etc/pam.d/sddm-autologin:auth        required    pam_env.so
/etc/pam.d/sddm-greeter:# Load environment from /etc/environment and ~/.pam_environment
/etc/pam.d/sddm-greeter:auth            required pam_env.so
/etc/pam.d/su:session    required     pam_env.so
/etc/pam.d/system-auth:auth             required        pam_env.so
/etc/pam.d/system-auth:session          required        pam_env.so
/etc/pam.d/system-login:session         required        pam_env.so
/etc/pam.d/system-services:session              required        pam_env.so

The file /etc/environment is another completely commented out example file.

The ~/pam_environment file doesn't exist for any of my users.

However, I finally thought to execute:
env | sort:
...
KONSOLE_PROFILE_NAME=Shell
LANG=en_US.UTF-8
LANGUAGE=en_US:ja
LC_COLLATE=C
...

LANG I expected. LANGUAGE is a new one to me but appears to be the culprit here. I'm grepping through my user directory now to see where it's set.

resolved Thu Dec 22 21:25:40 EST 2016
First, there were no places in the affected user account where LANGUAGE was set.

Apparently, several years ago, LANGUAGE was set and exported in order to meet one of the input method packages' requirements.

It turns out there is a very interesting line in file:
cat /etc/sudoers:
...
##
## Locale settings
# Defaults env_keep += "LANG LANGUAGE LINGUAS LC_* _XKB_CHARSET"
##
...

Normal behavior for per user environment variable settings is that something somewhere in the user's account explicitly sets them. In this case, the sudo environment variables are kept separately in a centralized location in a conceptually similar manner that user login information is kept.

I tried several tests changing the value of LANGUAGE:
Code:
guynonet@pyrogyro ~ $ export LANGUAGE='en_US.UTF'
guynonet@pyrogyro ~ $ su -
Password:
su: Authentication failure
guynonet@pyrogyro ~ $ export LANGUAGE='en_US.UTF:ja'
guynonet@pyrogyro ~ $ su -
パスワード:
su: 認証失敗
guynonet@pyrogyro ~ $ export LANGUAGE='ja:en_US.UTF'
guynonet@pyrogyro ~ $ su -
パスワード:
su: 認証失敗
guynonet@pyrogyro ~ $ export LANGUAGE='en_US.UTF-8:ja'
guynonet@pyrogyro ~ $ su -
パスワード:
su: 認証失敗
guynonet@pyrogyro ~ $ export LANGUAGE='ja:en_US.UTF-8'
guynonet@pyrogyro ~ $ su -
パスワード:
su: 認証失敗
guynonet@pyrogyro ~ $ export LANGUAGE='en_US.UTF-8'
guynonet@pyrogyro ~ $ su -
Password:
su: Authentication failure
guynonet@pyrogyro ~ $ export LANGUAGE='en:ja'
guynonet@pyrogyro ~ $ su -
パスワード:
su: 認証失敗

As in plainly apparent, including 'ja' in LANGUAGE always resulted in using Japanese in the system prompts for su{do}. I would have expected to be prompted in the language of choice by the order the LANGUAGE appeared. i.e. Being prompted in English when en_US appeared first.

It's not clear to me how LANGUAGE is expected to work anymore so I'm setting it to null. It's not clear to me if LANGUAGE is even supported anymore given the changes in L10N and LINGUAS. Perhaps it's retention in sudoers is to keep backwards compatibility. I don't begin to have the knowledge base to figure this one out!

To resolve this, I logged out of KDE and back to my CLI level. I then executed
Code:
export LANGUAGE=''

After logging back into KDE, 'su -' now prompts in English {the default} and therefore works as expected.
_________________
People whom think M$ is mediocre, don't know the half of it.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum