You are not logged in.

#1 2022-01-13 22:38:51

mepqfilho
Member
Registered: 2017-01-02
Posts: 32

[SOLVED] Locale changed, but Konsole/pacman are on old configuration

I have recently changed the locale on my installation and everything on my DE seems to reflect the change, except Konsole and pacman/yay. I've searched around for configuration files, but haven't found a single line where they would set a language to override the system's defaults.

As of now, the following commands give these respective outputs:

$ locale
ANG=en_GB.UTF-8
LC_CTYPE="en_GB.UTF-8"
LC_NUMERIC="en_GB.UTF-8"
LC_TIME="en_GB.UTF-8"
LC_COLLATE="en_GB.UTF-8"
LC_MONETARY="en_GB.UTF-8"
LC_MESSAGES="en_GB.UTF-8"
LC_PAPER="en_GB.UTF-8"
LC_NAME="en_GB.UTF-8"
LC_ADDRESS="en_GB.UTF-8"
LC_TELEPHONE="en_GB.UTF-8"
LC_MEASUREMENT="en_GB.UTF-8"
LC_IDENTIFICATION="en_GB.UTF-8"
LC_ALL=
$ localectl
   System Locale: LANG=en_GB.UTF-8
       VC Keymap: br-abnt2
      X11 Layout: n/a
$ locale -a
C
en_GB.utf8
en_US.utf8
ja_JP.utf8
POSIX
pt_BR.utf8
$ cat .config/plasma-localerc
[Formats]
LANG=en_GB.UTF-8

However, despite all relevant configuration files pointing out that English is the main language, when I open up Konsole, menus are still in Japanese (the previously set language):

https://i.imgur.com/62CqgDO.png

Also, pacman/yay outputs are also shown in Japanese:

$ pacman --help
使用方法:  pacman <オペレーション> [...]
オペレーション:
    pacman {-h --help}
    pacman {-V --version}
    pacman {-D --database} <オプション> <パッケージ>
    pacman {-F --files}    [オプション] [ファイル]
    pacman {-Q --query}    [オプション] [パッケージ]
    pacman {-R --remove}   [オプション] <パッケージ>
    pacman {-S --sync}     [オプション] [パッケージ]
    pacman {-T --deptest}  [オプション] [パッケージ]
    pacman {-U --upgrade}  [オプション] <ファイル>

オペレーションと一緒に 'pacman {-h --help}' を使うことでオプションを一覧できます
$ sudo pacman -Syu
:: パッケージデータベースの同期中...
 core は最新です
 extra は最新です
 community は最新です
 multilib は最新です
:: システム全体の更新を開始...
依存関係を解決しています...
衝突するパッケージがないか確認しています...

パッケージ (3) linux-5.16.arch1-1  linux-firmware-20211216.f682ecb-1  linux-headers-5.16.arch1-1

合計ダウンロード容量:         986.46 MiB
合計インストール容量:        3488.34 MiB
最終的なアップグレード容量:    50.57 MiB

:: インストールを行いますか? [Y/n]

I thought it could be some configuration specific to Konsole, but ~/.config/konsolerc has nothing on language (though the color scheme "default" is written in Japanese. Tried to set it to "Default", but it reverts back on relaunching Konsole):

MenuBar=Disabled
State=AAAA/wAAAAD9AAAAAAAABu0AAANAAAAABAAAAAQAAAAIAAAACPwAAAABAAAAAgAAAAIAAAAWAG0AYQBpAG4AVABvAG8AbABCAGEAcgEAAAAA/////wAAAAAAAAAAAAAAHABzAGUAcwBzAGkAbwBuAFQAbwBvAGwAYgBhAHIBAAABzf////8AAAAAAAAAAA==
StatusBar=Disabled

[Desktop Entry]
DefaultProfile=My Profile.profile

[Favorite Profiles]
Favorites=

[KonsoleWindow]
RememberWindowSize=false

[MainWindow]
DP-2 Height 1280x1024=878
DP-2 Height 2560x1080=878
DP-2 Height 3840x1600=878
DP-2 Width 1280x1024=1773
DP-2 Width 2560x1080=1773
DP-2 Width 3840x1600=1773
DP-2 XPosition 1280x1024=787
DP-2 XPosition 2560x1080=0
DP-2 XPosition 3840x1600=1864
DP-2 YPosition 1280x1024=121
DP-2 YPosition 2560x1080=58
DP-2 YPosition 3840x1600=344
HDMI-1 Height 3840x1600=878
HDMI-1 Width 3840x1600=1773
HDMI-1 XPosition 3840x1600=0
HDMI-1 YPosition 3840x1600=58
MenuBar=Disabled
RestorePositionForNextInstance=false
State=AAAA/wAAAAD9AAAAAQAAAAAAAAAAAAAAAPwCAAAAAfsAAAAcAFMAUwBIAE0AYQBuAGEAZwBlAHIARABvAGMAawAAAAAA/////wAAANUBAAADAAAG7QAAA0AAAAAEAAAABAAAAAgAAAAI/AAAAAEAAAACAAAAAgAAABYAbQBhAGkAbgBUAG8AbwBsAEIAYQByAQAAAAD/////AAAAAAAAAAAAAAAcAHMAZQBzAHMAaQBvAG4AVABvAG8AbABiAGEAcgEAAAEH/////wAAAAAAAAAA
StatusBar=Disabled
ToolBarsMovable=Disabled
eDP-1 Height 1366x768=764
eDP-1 Width 1366x768=1358
eDP-1 XPosition 1366x768=4
eDP-1 YPosition 1366x768=0

[TabBar]
CloseTabButton=OnTabBar
TabBarVisibility=AlwaysShowTabBar

[UiSettings]
ColorScheme=デフォルト

Since there is not indication to a locale configuration to pacman in the Wiki, I think the problem might be related to the variable LANGUAGE, which shows Japanese as the first fallback language:

$ echo $LANGUAGE
ja:en_GB:pt_BR

However, I appended the same string in a different order to /etc/locale.conf and after rebooting the variable was also appended:

$ echo $LANGUAGE
ja:en_GB:pt_BR:en_GB:pt_BR:ja

Should the problem lie with this environment variable, what is the correct way to reconfigure it? If not, then what other possible configurations might be messing with Konsole and pacman specifically?

moderator edit -- replaced oversized image with link.
Pasting pictures and code

Last edited by mepqfilho (2022-01-22 22:47:04)

Offline

#2 2022-01-14 03:50:16

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 15,083

Re: [SOLVED] Locale changed, but Konsole/pacman are on old configuration

That LANGUAGE variable is generally set by plasma, check plasma settings that the "order" of languages is as you intend, alternatively fix it directly by adjusting ~/.config/plasma-localerc

Offline

#3 2022-01-18 23:15:34

mepqfilho
Member
Registered: 2017-01-02
Posts: 32

Re: [SOLVED] Locale changed, but Konsole/pacman are on old configuration

Plasma Settings → Language only lists British English, but UI on settings and Konsole are still in Japanese (https://i.imgur.com/B18kR2i.png).

I've set the language variable directly on ~/.config/plasma-localerc, but something else is overriding it on reboot:

$ cat ~/.config/plasma-localerc
[Formats]
LANG=en_GB.UTF-8
LANGUAGE=en_GB:pt_BR:ja

[Translations]
LANGUAGE=en_GB
$ echo $LANGUAGE
ja:en_GB:pt_BR:en_GB

That "Translations" section on the Plasma configuration wasn't there until after I rebooted, though.

And I checked just to be sure, but there is no export of a LANGUAGE variable in my .zshrc file.

Last edited by mepqfilho (2022-01-18 23:16:23)

Offline

#4 2022-01-19 07:35:56

seth
Member
Registered: 2012-09-03
Posts: 26,570

Re: [SOLVED] Locale changed, but Konsole/pacman are on old configuration

Let's see whether and what locales are on the konsole process:

tr '\0' '\n' < /proc/$(pidof konsole)/environ

Online

#5 2022-01-19 14:56:32

mepqfilho
Member
Registered: 2017-01-02
Posts: 32

Re: [SOLVED] Locale changed, but Konsole/pacman are on old configuration

Thanks, I had never seen that command before. Here's the output:

SHELL=/usr/bin/zsh
XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session1
GTK_IM_MODULE=fcitx
XMODIFIERS=@im=fcitx
DESKTOP_SESSION=plasma
XDG_SEAT=seat0
PWD=/home/myuser
XDG_SESSION_DESKTOP=KDE
LOGNAME=myuser
XDG_SESSION_TYPE=x11
XAUTHORITY=/home/myuser/.Xauthority
MOTD_SHOWN=pam
HOME=/home/myuser
XDG_CURRENT_DESKTOP=KDE
XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
XDG_SESSION_CLASS=user
USER=myuser
PAM_KWALLET5_LOGIN=/run/user/1000/kwallet5.socket
DISPLAY=:0
SHLVL=0
QT_IM_MODULE=fcitx
XDG_VTNR=1
XDG_SESSION_ID=2
XDG_RUNTIME_DIR=/run/user/1000
PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/home/myuser/.local/bin
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
MAIL=/var/spool/mail/myuser
OLDPWD=/home/myuser
LANG=en_GB.UTF-8
GTK_MODULES=canberra-gtk-module
_=/usr/bin/startplasma-x11
LANGUAGE=en_GB
XCURSOR_THEME=Bibata-Modern-Amber
XCURSOR_SIZE=28
QT_AUTO_SCREEN_SCALE_FACTOR=0
KDE_FULL_SESSION=true
KDE_SESSION_VERSION=5
KDE_SESSION_UID=1000
KDE_APPLICATIONS_AS_SCOPE=1
XDG_CONFIG_DIRS=/home/myuser/.config/kdedefaults:/etc/xdg
SYSTEMD_EXEC_PID=900
GTK_RC_FILES=/etc/gtk/gtkrc:/home/myuser/.gtkrc:/home/myuser/.config/gtkrc
GTK2_RC_FILES=/etc/gtk-2.0/gtkrc:/home/myuser/.gtkrc-2.0:/home/myuser/.config/gtkrc-2.0
SESSION_MANAGER=local/archlinux:@/tmp/.ICE-unix/970,unix/archlinux:/tmp/.ICE-unix/970
DESKTOP_STARTUP_ID=archlinux;1642603813;231640;1033_TIME2868073

Offline

#6 2022-01-19 15:00:11

seth
Member
Registered: 2012-09-03
Posts: 26,570

Re: [SOLVED] Locale changed, but Konsole/pacman are on old configuration

LANG=en_GB.UTF-8
…
LANGUAGE=en_GB

So it's something that zsh sources, https://man.archlinux.org/man/extra/zsh … DOWN_FILES

---
That's just the process environment and "tr" "translates" the 0-termination into a newline so a human can actually read that ;-)

Online

#7 2022-01-19 21:55:04

mepqfilho
Member
Registered: 2017-01-02
Posts: 32

Re: [SOLVED] Locale changed, but Konsole/pacman are on old configuration

Could we be dealing with two separate problems? I'm not sure if Zsh could impact Plasma's UI (as shown in the pictures here and here).

Either way, should I be looking at other possible locations for Zsh commands in my folders aside from those mentioned in the man pages for startup and shutdown?

/etc/zshenv does not exist. We have only /etc/zsh/zprofile:

$ cat /etc/zsh/zprofile
emulate sh -c 'source /etc/profile'

Within /etc/profile we have a reference to the profiles in profile.d:

$ cat /etc/profile
umask 022

append_path () {
    case ":$PATH:" in
        *:"$1":*)
            ;;
        *)
            PATH="${PATH:+$PATH:}$1"
    esac
}

append_path '/usr/local/sbin'
append_path '/usr/local/bin'
append_path '/usr/bin'

export PATH

if test -d /etc/profile.d/; then
        for profile in /etc/profile.d/*.sh; do
                test -r "$profile" && . "$profile"
        done
        unset profile
fi

unset -f append_path

if test "$BASH" &&\
   test "$PS1" &&\
   test -z "$POSIXLY_CORRECT" &&\
   test "${0#-}" != sh &&\
   test -r /etc/bash.bashrc
then
        . /etc/bash.bashrc
fi

unset TERMCAP

unset MANPATH

Within /etc/profile.d we do have a script for locale, but it doesn't seem to do anything other than to refer directly to the LANG variable:

if [ -z "$LANG" ]; then
  if [ -n "$XDG_CONFIG_HOME" ] && [ -r "$XDG_CONFIG_HOME/locale.conf" ]; then
    . "$XDG_CONFIG_HOME/locale.conf"
  elif [ -n "$HOME" ] && [ -r "$HOME/.config/locale.conf" ]; then
    . "$HOME/.config/locale.conf"
  elif [ -r /etc/locale.conf ]; then
    . /etc/locale.conf
  fi
fi

LANG=${LANG:-C}

export LANG LANGUAGE LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY \
       LC_MESSAGES LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT \
       LC_IDENTIFICATION

In the above case, we already have LANG set to en_GB in /etc/locale.conf, XDG_CONFIG_HOME returns empty and there is no file under $HOME/.config/locale.conf

Just in case it's relevant:

$ ls /etc/profile.d
freetype2.sh  gawk.csh  gawk.sh  gpm.sh  jre.csh  jre.sh  locale.sh  PackageKit.sh  perlbin.csh  perlbin.sh  vte.csh  vte.sh

ZDOTDIR is not set and returns empty.

Inside my home folder, we have only ~/.zshrc:

if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
  source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi

export ZSH="/home/myuser/.oh-my-zsh"

ZSH_THEME="powerlevel10k/powerlevel10k"

plugins=(git archlinux virtualenvwrapper zsh-syntax-highlighting zsh-autosuggestions aliases)

source $ZSH/oh-my-zsh.sh

# IN .zshrc THIS IS COMMENTED, BUT UNCOMMENTING CHANGES NOTHING AFTER SOURCING
# You may need to manually set your language environment
# export LANG=en_US.UTF-8

[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh

export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python
export VIRTUALENVWRAPPER_SCRIPT=/usr/bin/virtualenvwrapper.sh
source /usr/bin/virtualenvwrapper_lazy.sh

# Created by `pipx` on 2021-03-13 22:43:29
export PATH="$PATH:/home/myuser/.local/bin"

POWERLEVEL9K_SHORTEN_DIR_LENGTH=3
POWERLEVEL9K_SHORTEN_STRATEGY="truncate_first_and_last"
POWERLEVEL9K_SHORTEN_DELIMITER=".."

export EDITOR=$(which vim)
export SCM=$(which git)

eval "$(bw completion --shell zsh); compdef _bw bw;"

setopt HIST_IGNORE_SPACE
alias jrnl=" jrnl"

alias tl="task list"
alias tcx="task context"
alias ta="task active"

alias mkv="mkvirtualenv"
alias lsv="lsvirtualenv -b"

alias ez="$EDITOR $HOME/.zshrc"
alias sz="source $HOME/.zshrc"
alias eq="$EDITOR $HOME/.config/qutebrowser/config.py"

alias gdot="$SCM --git-dir=$HOME/.dotfiles --work-tree=$HOME"

Like the first case, there is no /etc/zprofile, /etc/zlogin or /etc/zlogout

Last edited by mepqfilho (2022-01-19 21:56:10)

Offline

#8 2022-01-19 22:01:32

Slithery
Forum Moderator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 4,875

Re: [SOLVED] Locale changed, but Konsole/pacman are on old configuration

You're using oh-my-zsh which is the cause of all sorts of random issues like this.
Get rid of it and try again.


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#9 2022-01-19 22:38:30

mepqfilho
Member
Registered: 2017-01-02
Posts: 32

Re: [SOLVED] Locale changed, but Konsole/pacman are on old configuration

In this case, shouldn't changing the user's default shell back to bash and rebooting solve the problem?

Offline

#10 2022-01-19 22:42:00

Slithery
Forum Moderator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 4,875

Re: [SOLVED] Locale changed, but Konsole/pacman are on old configuration

mepqfilho wrote:

In this case, shouldn't changing the user's default shell back to bash and rebooting solve the problem?

You'd hope so, but I wouldn't be at all surprised if oh-my-zsh has written random crap to any of the other commonly sourced files as part of infecting your system with its flailing tentacles when first installed.


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#11 2022-01-19 22:50:54

mepqfilho
Member
Registered: 2017-01-02
Posts: 32

Re: [SOLVED] Locale changed, but Konsole/pacman are on old configuration

Yeah, changing to bash didn't solve the problem, unfortunately.

But in this case, most likely I'm going to have to search manually for the corrupted line(s). I'd bet oh-my-zsh will only remove its usual files upon uninstallation and while messing with commonly sourced files when first configured, will not do anything about them on the way out. sad

Offline

#12 2022-01-20 07:58:20

seth
Member
Registered: 2012-09-03
Posts: 26,570

Re: [SOLVED] Locale changed, but Konsole/pacman are on old configuration

mepqfilho wrote:

I'm not sure if Zsh could impact Plasma's UI

mepqfilho previsously wrote:

everything on my DE seems to reflect the change, except Konsole and pacman/yay

Did you start the affected plasma applications from the interactive shell that has

mepqfilho's zsh wrote:

$ echo $LANGUAGE
ja:en_GB:pt_BR:en_GB

?

Yeah, changing to bash didn't solve the problem, unfortunately.

Did you log-out and back in after chsh or did you just run "bash" from within an affected zsh?

Either way, screw plasma.
Log into a linux console (eg. Ctrl+Alt+F3) and check the locale settings there.
If they're bad, that pretty much guarantees that it's not a plasma setting that's causing this. And if (in case) they're not for a bash login, it's gonna be zsh specific - otherwise a more general profile, eg. ~/.profile?

Online

#13 2022-01-21 23:13:09

mepqfilho
Member
Registered: 2017-01-02
Posts: 32

Re: [SOLVED] Locale changed, but Konsole/pacman are on old configuration

Sorry, should've stated how I changed my shell instead of just saying it didn't work.

I think I did it properly:

Changed the default shell of Konsole to bash to /bin/bash.

Changed the user's default shell:

sudo usermod -s /bin/bash myuser

Rebooted, no change when logging back to plasma, but when done through the tty into bash, the pacman prompts are finally shown in English, and the LANGUAGE variable is empty.

If they're bad, that pretty much guarantees that it's not a plasma setting that's causing this. And if (in case) they're not for a bash login, it's gonna be zsh specific - otherwise a more general profile, eg. ~/.profile?

I did search through my user's folders for other possible profile files, but nothing directly related to zsh on either .config or .local, and no ~/.profile file or directory.

One thing I noticed is that when zsh was my default shell, it pointed to /usr/bin/zsh. Should it point to /bin/zsh instead?

Offline

#14 2022-01-22 08:34:46

seth
Member
Registered: 2012-09-03
Posts: 26,570

Re: [SOLVED] Locale changed, but Konsole/pacman are on old configuration

when done through the tty into bash, the pacman prompts are finally shown in English, and the LANGUAGE variable is empty

So it's about the plasma session or maybe your DM - what's the locale if instead into plasma, you log into eg. an openbox session?


Should it point to /bin/zsh instead?

They're the same binary, the only relevant part is that the path shows up in /etc/shells

Online

#15 2022-01-22 13:50:34

mepqfilho
Member
Registered: 2017-01-02
Posts: 32

Re: [SOLVED] Locale changed, but Konsole/pacman are on old configuration

I'm using SDDM, back when when I first changed the Plasma settings on ~/.config/plasma-localerc, SDDM's language prompt would also display the desired language.

Inside /etc, I have /etc/sddm.conf (which is empty) and /etc/sddm.conf.d/kde_settings.conf, but nothing related to language:]

$ cat /etc/sddm.conf.d/kde_settings.conf
[Autologin]
Relogin=false
Session=
User=

[General]
HaltCommand=/usr/bin/systemctl poweroff
RebootCommand=/usr/bin/systemctl reboot

[Theme]
Current=breeze

[Users]
MaximumUid=60000
MinimumUid=1000

Last edited by mepqfilho (2022-01-22 13:53:43)

Offline

#16 2022-01-22 13:58:09

seth
Member
Registered: 2012-09-03
Posts: 26,570

Re: [SOLVED] Locale changed, but Konsole/pacman are on old configuration

seth wrote:

what's the locale if instead into plasma, you log into eg. an openbox session?

sudo cat /proc/$(pidof sddm)/environ | tr '\0' '\n'

Online

#17 2022-01-22 14:45:49

mepqfilho
Member
Registered: 2017-01-02
Posts: 32

Re: [SOLVED] Locale changed, but Konsole/pacman are on old configuration

After installing openbox, SDDM now presents me three options for a session's' DE: Plasma (X11), Openbox and KDE/Openbox.

In Openbox, the output of the environment lists English:

$ sudo cat /proc/$(pidof sddm)/environ | tr '\0' '\n'
LANG=en_GB.UTF-8
PATH=/usr/local/sbin:/usr/local/bin:/usr/bin
INVOCATION_ID=98322056b87343f1869b0735436aefdc
JOURNAL_STREAM=8:19606
SYSTEMD_EXEC_PID=435

However, Konsole still shows those buttons in Japanese, as well as sudo and pacman displaying outputs in Japanese.

One thing I noticed (and I'm not sure it should be there) is that on Openbox, the Latte dock I'm using also shows up (and I've always thought it was something to be used exclusively with Plasma). There is ~/.config/latte (with four .latte files) and ~/.config/lattedockrc, but as I expected, nothing related to language there:

$ cat .config/lattedockrc
[KFileDialog Settings]
listViewIconSize=16

[PlasmaThemeExtended]
outlineWidth=1

[ScreenConnectors]
10=eDP-1:::0,0 1024x768
11=HDMI-1:::0,0 3840x1600
12=eDP-1-1:::0,0 1920x1080
13=HDMI-1-1:::0,0 1920x1080
14=DP-2:::0,0 3840x1600

[UniversalSettings]
badges3DStyle=false
canDisableBorders=false
contextMenuActionsAlwaysShown=
currentLayout=Default
downloadWindowSize=800,550
inAdvancedModeForEditSettings=false
isAvailableGeometryBroadcastedToPlasma=true
lastNonAssignedLayout=Default
launchers=
layoutsColumnWidths=112,70,63,0
layoutsWindowSize=700,563
memoryUsage=0
metaPressAndHoldEnabled=true
mouseSensitivity=2
screenTrackerInterval=2500
showInfoWindow=true
singleModeLayoutName=Default
version=2

Offline

#18 2022-01-22 14:54:18

seth
Member
Registered: 2012-09-03
Posts: 26,570

Re: [SOLVED] Locale changed, but Konsole/pacman are on old configuration

konsole will most likely read some plasma settings - or its own.
Does it also have the bogus LANGUAGE in the openbox session?

tr '\0' '\n' < /proc/$(pidof konsole)/environ

Online

#19 2022-01-22 15:33:09

mepqfilho
Member
Registered: 2017-01-02
Posts: 32

Re: [SOLVED] Locale changed, but Konsole/pacman are on old configuration

I think it's definitely something to do with Plasma:

  • The System Settings, like Konsole, has a lot of elements in Japanese despite the locale now being set to English;

  • It must be something relatively small that's affecting those two, because for all KDE applications I've opened the locale has been changed completely (I've checked this with KTorrent, Kate, Okular, KolourPaint and KMix);

  • I've installed a completely different terminal emulator (Qterminal) and pacman outputs are shown in English, even when logged into Plasma.

However, I'm at loss now since getting the environment variables from within Konsole shows LANGUAGE as English, but echoing it will show the bogus one:

$ tr '\0' '\n' < /proc/$(pidof konsole)/environ
SHELL=/usr/bin/zsh
XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session9
GTK_IM_MODULE=fcitx
XMODIFIERS=@im=fcitx
DESKTOP_SESSION=plasma
XDG_SEAT=seat0
PWD=/home/myuser
XDG_SESSION_DESKTOP=KDE
LOGNAME=myuser
XDG_SESSION_TYPE=x11
XAUTHORITY=/home/myuser/.Xauthority
MOTD_SHOWN=pam
HOME=/home/myuser
XDG_CURRENT_DESKTOP=KDE
XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
XDG_SESSION_CLASS=user
USER=myuser
PAM_KWALLET5_LOGIN=/run/user/1000/kwallet5.socket
DISPLAY=:0
SHLVL=0
QT_IM_MODULE=fcitx
XDG_VTNR=1
XDG_SESSION_ID=11
XDG_RUNTIME_DIR=/run/user/1000
PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/home/myuser/.local/bin
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
MAIL=/var/spool/mail/myuser
OLDPWD=/home/myuser
LANG=en_GB.UTF-8
GTK_MODULES=canberra-gtk-module
_=/usr/bin/startplasma-x11
LANGUAGE=en_GB                                                                # THE VARIABLE SEEMS TO BE ALRIGHT!
XCURSOR_THEME=Bibata-Modern-Amber
XCURSOR_SIZE=28
QT_AUTO_SCREEN_SCALE_FACTOR=0
KDE_FULL_SESSION=true
KDE_SESSION_VERSION=5
KDE_SESSION_UID=1000
KDE_APPLICATIONS_AS_SCOPE=1
XDG_CONFIG_DIRS=/home/myuser/.config/kdedefaults:/etc/xdg
SYSTEMD_EXEC_PID=909
GTK_RC_FILES=/etc/gtk/gtkrc:/home/myuser/.gtkrc:/home/myuser/.config/gtkrc
GTK2_RC_FILES=/etc/gtk-2.0/gtkrc:/home/myuser/.gtkrc-2.0:/home/myuser/.config/gtkrc-2.0
SESSION_MANAGER=local/archlinux:@/tmp/.ICE-unix/2742,unix/archlinux:/tmp/.ICE-unix/2742
DESKTOP_STARTUP_ID=archlinux;1642864323;484418;2798_TIME1168343
$ echo $LANGUAGE
ja:en_GB:pt_BR:en_GB # Where is ja:en_GB:pt_BR coming from? The second en_GB is coming from plasma-localerc

Double checked .config/plasma-localerc:

$ cat .config/plasma-localerc
[Formats]
LANG=en_GB.UTF-8

[Translations]
LANGUAGE=en_GB # This is the en_GB that is appended to the bogus $LANGUAGE

Offline

#20 2022-01-22 15:38:28

seth
Member
Registered: 2012-09-03
Posts: 26,570

Re: [SOLVED] Locale changed, but Konsole/pacman are on old configuration

It was also in https://bbs.archlinux.org/viewtopic.php … 4#p2016684 so if it's not a shell include, konsole must get that value from somewhere and export it down.
You could try "konsole -e top" and the the environment of the top process to be absolutely sure and then in doubt just move away the konsolerc…

Online

#21 2022-01-22 21:26:35

mepqfilho
Member
Registered: 2017-01-02
Posts: 32

Re: [SOLVED] Locale changed, but Konsole/pacman are on old configuration

Ok, so now something really interesting came up.

First, I just decided to move away both .config/plasma-localerc and .config/konsolerc. Rebooted and Konsole still has its UI and pacman outputs in Japanese.

However, when launching top from within Konsole, top's interface is now displayed in Portguese. The terminal displays some messages before launching a new window, though:

$ konsole -e top
Icon theme "Surfn" not found.
Icon theme "Numix" not found.
Icon theme "Numix-Circle-Light" not found.
Icon theme "Numix-Circle" not found.
Icon theme "gnome" not found.              # I've always got these messages in lots of applications, but never bothered to solve
KTranscript: Loaded module: /usr/share/locale/ja/LC_SCRIPTS/ki18n5/ki18n5.js

The JavaScript is what bugs me: how can a script for Japanese language make an application launch in Portuguese? Here's the script file, just in case (although taking a quick look at it, it doesn't seem to indicate anything out of the ordinary):

// kdelibs4.js of Japanese KDE translation
// Maintained by Chusslove Illich <caslav.ilic@gmx.net>

// +++ Global dictionary of states.
// _states_[state], if defined, is set to some value for the state.
var _states_ = {};

// *** Set global states to values.
// : setStates(state1 value1 state2 value2 ...)
// Returns empty string.
function setStates (/*...*/) {
    var f = "setStates: ";
    if (arguments.length % 2 != 0) {
        throw Error(f + "must have even number of arguments");
    }
    for (var i = 0; i < arguments.length; i += 2) {
        var state = arguments[i];
        var val = arguments[i + 1];
        _states_[state] = val;
    }
    return "";
}

// *** Get global state value; empty string if not defined.
function getState (state) {
    if (state in _states_) {
        return _states_[state];
    }
    return "";
}

// *** Set properties to the phrase given by current msgstrf.
// : setMsgstrProperties(prop1 value1 prop2 value2...)
// Returns empty string.
function setMsgstrProperties (/*...*/) {
    var f = "setMsgstrProperties: ";
    if (arguments.length % 2 != 0) {
        throw Error(f + "must have even number of arguments");
    }

    var phrase = Ts.msgstrf();
    for (var i = 0; i < arguments.length; i += 2) {
        var property = arguments[i];
        var val = arguments[i + 1];
        Ts.setProp(phrase, property, val);
    }
    return "";
}

// *** Get property value of the given phrase; empty string if not defined.
function getProperty (phrase, property) {
    var val = Ts.getProp(phrase, property);
    if (!val) {
        return "";
    }
    return val;
}

// *** Get form of the given phrase.
// A "form" is taken to be a special type of property which defaults to the
// phrase itself when not defined. Hence, if the requested form has not been
// defined, phrase is returned as is.
function getFormProperty (phrase, formm) {
    var val = Ts.getProp(phrase, formm);
    if (!val) {
        return phrase;
    }
    return val;
}

// *** Select one of the strings according to the test value.
// : selectByValue(testvalue value1 str1 value2 str2 ... defaultstr)
// Select the string to the first value equal to the test value,
// or returns default string if there is no match.
function selectByValue (/*...*/) {
    var f = "selectByValue: ";
    if (arguments.length % 2 != 0) {
        throw Error(f + "must have even number of arguments.");
    }
    if (arguments.length < 2)
        throw Error(f + "must have at least two arguments.");

    var testval = arguments[0];
    for (var i = 1; i < arguments.length - 1; i += 2) {
        var val = arguments[i];
        var str = arguments[i + 1];
        if (testval == val) {
            return str;
        }
    }
    // Return the default choice if no other returned before.
    return arguments[arguments.length - 1];
}

// *** Return first non-empty string among the arguments, or empty if all empty.
// : firstNonEmpty(str1 str2 ...)
function firstNonEmpty (/*...*/) {
    for (var i = 0; i < arguments.length; ++i) {
        if (arguments[i].length > 0) {
            return arguments[i];
        }
    }
    return "";
}

// *** Return the finalized ordinary msgstr.
function theMsgstr () {
    return Ts.msgstrf();
}

// *** If the first character in the phrase is non-Japanese, return
// the phrase with space added to the start, otherwise return as is.
function spaceOnDemandLeft (phrase) {
    if (phrase.length == 0) {
        return phrase;
    }
    var firstChar = phrase.charAt(0);
    if (firstChar != " " && firstChar < "\u2E00") {
        return " " + phrase;
    }
    return phrase;
}

// *** If the last character in the phrase is non-Japanese, return
// the phrase with space added to the end, otherwise return as is.
function spaceOnDemandRight (phrase) {
    if (phrase.length == 0) {
        return phrase;
    }
    var lastChar = phrase.charAt(phrase.length - 1);
    if (lastChar != " " && lastChar < "\u2E00") {
        return phrase + " ";
    }
    return phrase;
}

// *** Combination of spaceOnDemandLeft and spaceOnDemandRight: both first
// and last characters are checked, and spaces added where needed.
function spaceOnDemandBoth (phrase) {
    return spaceOnDemandLeft(spaceOnDemandRight(phrase));
}

// *** Strip the accelerator marker, composed of an ASCII alphanumeric
// within parenthesis (with or without an ampersand in front).
stripAccRx = /\((&|&amp;)?[a-zA-Z0-9]\)/;
function stripAccelerator (phrase) {
    return phrase.replace(stripAccRx, "");
}

// ==> Exports to PO calls
Ts.setcall("~set", setStates);
Ts.setcall("~get", getState);
Ts.setcall("~setProps", setMsgstrProperties);
Ts.setcall("~getProp", getProperty);
Ts.setcall("~getForm", getFormProperty);
Ts.setcall("~case", selectByValue);
Ts.setcall("~first", firstNonEmpty);
Ts.setcall("~this", theMsgstr);
Ts.setcall("~spacerL", spaceOnDemandLeft);
Ts.setcall("~spacerR", spaceOnDemandRight);
Ts.setcall("~spacerB", spaceOnDemandBoth);
Ts.setcall("~stripAccel", stripAccelerator);


// ------------------------------
// When verbs such as "Configure" are used as the positive answer in question
// dialogs, "設定する", as opposed to "設定しない (Do Not Configure)", would
// be more appropriate than "設定". However, it would sound funny if the same
// translation is used in other contexts (e.g. @title:window), so we cannot
// do it safely.
// Instead, attach the proper answers to the message caption/text in the PO,
// and then retrieve them in filtering messages for message dialog buttons
// in kdelibs4.po (those with context "@action:button filter-...").

// Dictionary of answers.
var _answers_ = {};

// Set answers as key-value pairs, as many as needed.
// The call always signals fallback.
function setAnswers (/*...*/)
{
    if (arguments.length % 2 != 0)
        throw Error("Answers setter given odd number of arguments.");

    for (var i = 0; i < arguments.length; i += 2) {
        var akey = arguments[i];
        var answer = arguments[i + 1];
        _answers_[akey] = answer;
    }

    throw Ts.fallback();
}
Ts.setcall("set-answers", setAnswers);
// msgid "... Would you like to configure it now?"
// msgstr ""
// "... 今設定しますか?"
// "|/|"
// "$[set-answers yes '設定する(&Y)' no '設定しない(&N)']"

// Get an answer by key.
// Signals fallback if the answer with the given key is not set.
// Deletes the answer from the dictionary, so that it doesn't happen
// that it gets retrieved in a later, unrelated question.
function getAnswer (akey)
{
    answer = _answers_[akey];
    if (!answer) throw Ts.fallback();
    delete _answers_[akey];
    return answer;
}
Ts.setcall("get-answer", getAnswer);
// msgctxt "@action:button filter-yes"
// msgid "%1"
// msgstr "%1|/|$[get-answer yes]"

// Reset all answers, so that they don't get used for the wrong question.
// Always signals fallback.
function resetAnswers ()
{
    _answers_ = {};
}
Ts.setcall("reset-answers", resetAnswers);
// msgctxt "@action:button post-filter"
// msgid "."
// msgstr ".|/|$[reset-answers]"

Offline

#22 2022-01-22 22:15:12

seth
Member
Registered: 2012-09-03
Posts: 26,570

Re: [SOLVED] Locale changed, but Konsole/pacman are on old configuration

how can a script for Japanese language make an application launch in Portuguese

Did you run that out of a konsole that still had "LANGUAGE=ja:en_GB:pt_BR:en_GB"?

The more curious part is: where does the "jp" or "br" come from after deleting .config/plasma-localerc…

strace konsole 2>&1 | grep -iE '(lang|locale)'

Online

#23 2022-01-22 22:46:30

mepqfilho
Member
Registered: 2017-01-02
Posts: 32

Re: [SOLVED] Locale changed, but Konsole/pacman are on old configuration

Finally found where the bogus LANGUAGE was hiding! Running strace, turns out there is a file in ~/.config/klanguageoverridesrc which was forcing exactly those two Plasma applications to display Japanese first:

[Language]
konsole=@ByteArray(ja:en_GB:pt_BR)
systemsettings5=@ByteArray(ja:en_GB:pt_BR)

Only had to remove this file and upon rebooting, everything was in English.

Offline

Board footer

Powered by FluxBB