You are not logged in.

#1 2019-03-30 08:14:01

deus_deceit
Member
From: Greece
Registered: 2013-02-10
Posts: 33

[SOLVED] LANGUAGE variable is set wrong

Language in terminal messages is in Greek... But not every time a message shows.

I am using plasma-desktop in case that matters

In my /etc/locale.conf

LANG=en_US.UTF-8

and in my /etc/locale.gen

en_US.UTF-8 UTF-8

Running locale command

~ ᐅ locale
LANG=en_US.UTF-8
LC_CTYPE=en_US.UTF-8
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

A grep on the environment variables shows me this

~ ᐅ env | grep LANG
LANGUAGE=en_US:el
LANG=en_US.UTF-8

I'm guessing that the problem here is the LANGUAGE variable which is set to en_US:el
The problem is that I have no clue how that variable is set or if that's really the problem.

I'll share some output so you can see what I'm getting from pacman when I get an error message:

~ ᐅ pacman -S lkasdjfaskld
σφάλμα: αυτή η λειτουργία απαιτεί προνόμια root.

But if I do something crazy in zsh the error message is in English

~ ᐅ asdasfd
zsh: command not found: asdasfd

I want everything terminal oriented to be in English. Help?

Last edited by deus_deceit (2019-03-31 11:56:32)

Offline

#2 2019-03-30 12:15:22

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: [SOLVED] LANGUAGE variable is set wrong

The LANGUAGE variable is not causing the pacman output to be in greek.  What are the outputs of `localectl` and `locale -a`?

What's in your zshrc or related configs?  Does the problem persist with clean shell configs and/or a new user?  Are you using OMZ by chance?

Last edited by Trilby (2019-03-30 12:17:08)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2019-03-30 18:30:41

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED] LANGUAGE variable is set wrong

Not an Installation issue, moving to NC...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#4 2019-03-31 05:48:07

deus_deceit
Member
From: Greece
Registered: 2013-02-10
Posts: 33

Re: [SOLVED] LANGUAGE variable is set wrong

Trilby wrote:

The LANGUAGE variable is not causing the pacman output to be in greek.  What are the outputs of `localectl` and `locale -a`?

What's in your zshrc or related configs?  Does the problem persist with clean shell configs and/or a new user?  Are you using OMZ by chance?

Thanks for taking the time and sorry for the long delay to reply but I couldn't come back here until now.

localectl output as requested:

~ ᐅ localectl 
   System Locale: LANG=en_US.UTF-8
                  LANGUAGE=en_US:en
       VC Keymap: n/a
      X11 Layout: n/a

locale -a output

~ ᐅ locale -a
C
en_US.utf8
POSIX

Yes I'm using oh-my-zsh, I don't see anything relevant in my .zshrc configuration.
It's exactly the same as what I was using prior the re-install and I didn't have any issues
like I do now.

But here it is anyway

# If you come from bash you might have to change your $PATH.
 export PATH=$HOME/bin:/usr/local/bin:$PATH

# Path to your oh-my-zsh installation.
export ZSH="/usr/share/oh-my-zsh"

# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME="muse" #"muse" #"agnoster" "muse"

# Set list of themes to pick from when loading at random
# Setting this variable when ZSH_THEME=random will cause zsh to load
# a theme from this variable instead of looking in ~/.oh-my-zsh/themes/
# If set to an empty array, this variable will have no effect.
# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )

# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"

# Uncomment the following line to use hyphen-insensitive completion.
# Case-sensitive completion must be off. _ and - will be interchangeable.
# HYPHEN_INSENSITIVE="true"

# Uncomment the following line to disable bi-weekly auto-update checks.
# DISABLE_AUTO_UPDATE="true"

# Uncomment the following line to change how often to auto-update (in days).
# export UPDATE_ZSH_DAYS=13

# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"

# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"

# Uncomment the following line to enable command auto-correction.
ENABLE_CORRECTION="false"

# Uncomment the following line to display red dots whilst waiting for completion.
COMPLETION_WAITING_DOTS="true"

# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"

# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# You can set one of the optional three formats:
# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# or set a custom format using the strftime function format specifications,
# see 'man strftime' for details.
# HIST_STAMPS="mm/dd/yyyy"

# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder

# Which plugins would you like to load?
# Standard plugins can be found in ~/.oh-my-zsh/plugins/*
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(
  git archlinux vi-mode
)

source $ZSH/oh-my-zsh.sh

# User configuration

# export MANPATH="/usr/local/man:$MANPATH"

# You may need to manually set your language environment
export LANG=en_US.UTF-8

# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
#   export EDITOR='vim'
# else
#   export EDITOR='mvim'
# fi

# Compilation flags
# export ARCHFLAGS="-arch x86_64"

# ssh
# export SSH_KEY_PATH="~/.ssh/rsa_id"

# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
#
alias vim=nvim
alias projects="cd ~/Projects"
alias jmodules="cd /opt/JUCE/modules"
alias introjucer="~/bin/Introjucer"
alias desktop="cd ~/Desktop"
alias downloads="cd ~/Downloads"
alias music="cd ~/music"
alias nvimrc="~/.config/nvim"
alias wine32='env WINEARCH=win32 WINEPREFIX="$HOME/.wine32" wine'
alias info="info --vi-keys"
alias music="ncmpcpp"
alias vtop="vtop -t nord"

#Add gem/bin in PATH
export PATH="/home/deus/.gem/ruby/2.5.0/bin:$PATH"

#Enable vim mode for zsh
bindkey -v

#Enable 256 colors for terminals
export TERM="xterm-256color"

#Debugging info for lldb-nvim pluggin. store at.
export NVIM_PYTHON_LOG_FILE=/tmp/nvlog

export NVIM_LISTEN_ADDRESS="/tmp/nvimsocket"

#default applications
export EDITOR="nvim"
export BROWSER="firefox"

#fix for slowness caused by git-plugin
function git_prompt_info() {
  ref=$(git symbolic-ref HEAD 2> /dev/null) || return
  echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$ZSH_THEME_GIT_PROMPT_SUFFIX"
}


if [[ -z $DISPLAY ]] && [[ $(tty) = /dev/tty1 ]]; then
    startx
fi

set -o vi

alias d100='rolldice 1d100%'
alias d20='rolldice 1d20%'
alias d12='rolldice 1d12%'
alias d8='rolldice 1d8%'
alias d6='rolldice 1d6%'
alias d4='rolldice 1d4%'
alias d2='rolldice 1d2%'

[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh

export PATH="$HOME/.config/yarn/global/node_modules/.bin:$PATH"
export PATH="$HOME/.yarn/bin:$PATH"
export PATH="$HOME/.cargo/bin:$PATH"
export PATH="$HOME/.cargo/bin/racer:$PATH"
export RUST_SRC_PATH="$(rustc --print sysroot)/lib/rustlib/src/rust/src/"
export DRI_PRIME=1

Offline

#5 2019-03-31 05:50:43

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED] LANGUAGE variable is set wrong

Can you reproduce using vanilla Zsh? I would guess not. OMZ is a mess, if you want a Zsh framework, Grml is the only sane one.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#6 2019-03-31 06:18:25

deus_deceit
Member
From: Greece
Registered: 2013-02-10
Posts: 33

Re: [SOLVED] LANGUAGE variable is set wrong

jasonwryan wrote:

Can you reproduce using vanilla Zsh? I would guess not. OMZ is a mess, if you want a Zsh framework, Grml is the only sane one.

I just completely uninstalled zsh to check if that's the problem and it's still the same.
Nothing changed other than my terminal getting uglier. heh.

Offline

#7 2019-03-31 06:34:37

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED] LANGUAGE variable is set wrong

How do you login and start your session? Please paste the relevant conf files.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#8 2019-03-31 06:59:59

deus_deceit
Member
From: Greece
Registered: 2013-02-10
Posts: 33

Re: [SOLVED] LANGUAGE variable is set wrong

jasonwryan wrote:

How do you login and start your session? Please paste the relevant conf files.

I'm using sddm to login with default setup? I did change its theme through kde-kcm (graphical user interface tool)I don't recall messing with any config files on that matter so its defaults.
I wouldn't even know which conf files to show to you guys unless you ask them specifically.

Offline

#9 2019-03-31 07:35:48

seth
Member
Registered: 2012-09-03
Posts: 59,855

Re: [SOLVED] LANGUAGE variable is set wrong

It's the LANGUAGE variable.
"el" is greek (el greco? ;-) and pacman doesn't have locales for the "en_US" locale

For me

LANGUAGE=en_US:de pacman -S 12345

answers in german

LANGUAGE=en_US:C:de pacman -S 12345

answers untranslated (still no en_US, but C of course always matches)

If you want your text shell sessions untranslated, I'd suggest to alter or drop the LANGUAGE var in youor zshrc - I assume KDE sets it for the session, but even then it seems weird to use greek as fallback to US english, *shrug*

Offline

#10 2019-03-31 07:36:25

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED] LANGUAGE variable is set wrong


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#11 2019-03-31 11:52:49

deus_deceit
Member
From: Greece
Registered: 2013-02-10
Posts: 33

Re: [SOLVED] LANGUAGE variable is set wrong

seth wrote:

It's the LANGUAGE variable.
"el" is greek (el greco? ;-) and pacman doesn't have locales for the "en_US" locale

For me

LANGUAGE=en_US:de pacman -S 12345

answers in german

LANGUAGE=en_US:C:de pacman -S 12345

answers untranslated (still no en_US, but C of course always matches)

If you want your text shell sessions untranslated, I'd suggest to alter or drop the LANGUAGE var in youor zshrc - I assume KDE sets it for the session, but even then it seems weird to use greek as fallback to US english, *shrug*

Yep, that was it and I'm glad you pointed it out cause I was about to go chasing unicorns if you know what I mean.
I added "export LANGUAGE=en_US:en" in my .zshrc and all is good with the world now.

P.S
I know "el" is for Greek btw, hence why I was guessing since the beginning that it was the LANGUAGE variable that was the problem.
el from ellinika/Ελληνικά = Greek.

Thank you.

Last edited by deus_deceit (2019-03-31 11:55:48)

Offline

#12 2019-03-31 15:15:25

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED] LANGUAGE variable is set wrong

So, you are still none the wiser about what sets it as Greek, you have just overwritten it?


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#13 2019-03-31 15:17:44

seth
Member
Registered: 2012-09-03
Posts: 59,855

Re: [SOLVED] LANGUAGE variable is set wrong

I'd check ~/.config/plasma-localerc …

Offline

#14 2019-03-31 15:42:36

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: [SOLVED] LANGUAGE variable is set wrong

I'm also curious about what else is going on.  That setting for LANGUAGE is not sufficient to cause the observed symptoms:

$ export LANGUAGE=en_US:el

$ pacman -S lkasdjfaskld
error: you cannot perform this operation unless you are root.

In contrast to seth's example, I also do not get a response in German by just setting LANGUAGE:

$ LANGUAGE=en_US:de pacman -S 12345
error: you cannot perform this operation unless you are root.

Last edited by Trilby (2019-03-31 15:43:51)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#15 2019-03-31 15:47:55

seth
Member
Registered: 2012-09-03
Posts: 59,855

Re: [SOLVED] LANGUAGE variable is set wrong

ls /usr/share/locale/en*/LC_MESSAGES/pacman.mo  /usr/share/locale/el/LC_MESSAGES/pacman.mo

There're only en_GB locales in the pacman package.

Edit, also

LANGUAGE=en_US:el strace pacman -S 12345 2>&1 | grep LC_M

Last edited by seth (2019-03-31 15:49:05)

Offline

#16 2019-03-31 15:50:24

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: [SOLVED] LANGUAGE variable is set wrong

Doh.  Sorry for the noise.  I forgot I have all non-en locales in pacman's NoExtract.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#17 2019-04-01 08:27:44

deus_deceit
Member
From: Greece
Registered: 2013-02-10
Posts: 33

Re: [SOLVED] LANGUAGE variable is set wrong

jasonwryan wrote:

So, you are still none the wiser about what sets it as Greek, you have just overwritten it?

I didn't really care to be wiser about plasma configuration I just wanted it to work. And since now it works I'm simply content.

seth wrote:

I'd check ~/.config/plasma-localerc …

You sir made me wiser though. That's  exactly where it was getting set.

[Formats]
LANG=en_US.UTF-8

[Translations]
LANGUAGE=en_US:el

Thanks!

Edit
I guess that wasn't the only place.
After doing a

~ ᐅ grep -R 'en_US:el' .config 
.config/plasma-locale-settings.sh:export LANGUAGE=en_US:el

Gotta love the terminal. After changing that to "en_US:en" I believe I'm finally over with this.

Thanks @everyone again.

Last edited by deus_deceit (2019-04-01 08:36:01)

Offline

Board footer

Powered by FluxBB