You are not logged in.

#1 2022-01-05 14:29:10

yuanhao
Member
From: Edinburgh, UK
Registered: 2021-11-12
Posts: 68
Website

[SOLVED]locale not perform correctly?

In terminal, I have already ran locale-gen and then create the /etc/locale.conf file with the line LANG=en_US.UTF-8.
However, when I run locale after that (same is true after reboot), it still shows

LANG=C
LC_CTYPE="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_COLLATE="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_PAPER="C"
LC_NAME="C"
LC_ADDRESS="C"
LC_TELEPHONE="C"
LC_MEASUREMENT="C"
LC_IDENTIFICATION="C"
LC_ALL=

I think it should show this (this shows when I run export LANG=en_US.UTF-8, but I dont want to write this every time I use terminal)

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=

Last edited by yuanhao (2022-01-18 19:42:43)

Offline

#2 2022-01-05 14:31:27

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,097

Re: [SOLVED]locale not perform correctly?

https://wiki.archlinux.org/title/Locale … the_locale

and check that the locale is actually built (run locale -a)

Last edited by Mr.Elendig (2022-01-05 14:32:15)


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

#3 2022-01-05 14:36:54

yuanhao
Member
From: Edinburgh, UK
Registered: 2021-11-12
Posts: 68
Website

Re: [SOLVED]locale not perform correctly?

locale -a gives me this:

C
en_US.utf8
POSIX
zh_CN
zh_CN.gb18030
zh_CN.gb2312
zh_CN.gbk
zh_CN.utf8

and I want to use en_US.utf8 so I set as the website says (I have tried editing /etc/locale.conf and run localectl set-locale LANG=en_US.UTF-8 and reboot)
but in the end still got every set to C when I run locale to check

Offline

#4 2022-01-05 14:54:53

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: [SOLVED]locale not perform correctly?

Which terminal is this? Do you see the same output for 'locale' at the console screen? if not then check the terminal configuration.

Which shell are you using? You should probably post your shell configuration files.


Jin, Jîyan, Azadî

Offline

#5 2022-01-05 15:13:17

yuanhao
Member
From: Edinburgh, UK
Registered: 2021-11-12
Posts: 68
Website

Re: [SOLVED]locale not perform correctly?

I use kde console, bash shell
for /etc/profile

# /etc/profile

# Set our umask
umask 022

# Append "$1" to $PATH when not already in.
# This function API is accessible to scripts in /etc/profile.d
append_path () {
    case ":$PATH:" in
        *:"$1":*)
            ;;
        *)
            PATH="${PATH:+$PATH:}$1"
    esac
}

# Append our default paths
append_path '/usr/local/sbin'
append_path '/usr/local/bin'
append_path '/usr/bin'

# Force PATH to be environment
export PATH

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

# Unload our profile API functions
unset -f append_path

# Source global bash config, when interactive but not posix or sh mode
if test "$BASH" &&\
   test "$PS1" &&\
   test -z "$POSIXLY_CORRECT" &&\
   test "${0#-}" != sh &&\
   test -r /etc/bash.bashrc
then
        . /etc/bash.bashrc
fi

# Termcap is outdated, old, and crusty, kill it.
unset TERMCAP

# Man is much better than us at figuring this out
unset MANPATH

for .bashrc

#
# ~/.bashrc
#

# If not running interactively, don't do anything
[[ $- != *i* ]] && return

alias ls='ls --color=auto'
PS1='[\u@\h \W]\$ '

export PATH=/home/yuanhao/.local/bin:${PATH}

export JAVA_HOME=/usr/lib/jvm/default

# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/home/yuanhao/anaconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
    eval "$__conda_setup"
else
    if [ -f "/home/yuanhao/anaconda3/etc/profile.d/conda.sh" ]; then
        . "/home/yuanhao/anaconda3/etc/profile.d/conda.sh"
    else
        export PATH="/home/yuanhao/anaconda3/bin:$PATH"
    fi
fi
unset __conda_setup
# <<< conda initialize <<<

# add cuda tools to command path
export PATH=/opt/cuda/bin:${PATH}
# add cuda libraries to library path
if [[ "${LD_LIBRARY_PATH}" != "" ]]
then
  export LD_LIBRARY_PATH=/opt/cuda/lib64:${LD_LIBRARY_PATH}
else
  export LD_LIBRARY_PATH=/opt/cuda/lib64
fi

Offline

#6 2022-01-05 15:19:07

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,296

Re: [SOLVED]locale not perform correctly?

plasma sometimes has weird issues with their locale setup, is the wrong locale present in ~/.config/plasma-localerc and does it get fixed if you manually fix it?

Offline

#7 2022-01-05 15:19:24

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,729

Re: [SOLVED]locale not perform correctly?

If you're on KDE, try deleting ~/.config/plasma-localerc if it exists.

Offline

#8 2022-01-05 15:29:13

yuanhao
Member
From: Edinburgh, UK
Registered: 2021-11-12
Posts: 68
Website

Re: [SOLVED]locale not perform correctly?

Thank you all!
It is the problem of kde, the file ~/.config/plasma-localerc contains wrong locale info, and I change it then reboot then everything goes fine smile

Offline

Board footer

Powered by FluxBB