LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-08-2023, 09:05 PM   #1
Enderbyte09
LQ Newbie
 
Registered: Jun 2023
Location: Vancouver, Canada
Distribution: Manjaro KDE Edition, Kubuntu, WSL, Raspberry Pi OS
Posts: 6

Rep: Reputation: 0
Question Command line output language does not match locale


So I recently had an "excellent" idea to add a second locale to my computer (zh-CN). To test it, I set it to the primary. It worked, so I changed it back to the old one (en-CA). However, now all of my command-line output is in Chinese! I tried to fix it by setting the locale to en_CA.UTF-8. This did not work and the CLI output is still chinese.
Code:
LANG=en_US.UTF-8
LC_CTYPE="en_CA.UTF-8"
LC_NUMERIC="en_CA.UTF-8"
LC_TIME="en_CA.UTF-8"
LC_COLLATE="en_CA.UTF-8"
LC_MONETARY="en_CA.UTF-8"
LC_MESSAGES="en_CA.UTF-8"
LC_PAPER="en_CA.UTF-8"
LC_NAME="en_CA.UTF-8"
LC_ADDRESS="en_CA.UTF-8"
LC_TELEPHONE="en_CA.UTF-8"
LC_MEASUREMENT="en_CA.UTF-8"
LC_IDENTIFICATION="en_CA.UTF-8"
LC_ALL=en_CA.UTF-8
That is the output of my locale.
I found that by running export LC_ALL=C, I could get it back to english but UTF 8 characters do not work. I would prefer my terminal support UTF 8 and English like it used to.
I also added to my bash startup profile
Code:
export LC_ALL=en_CA.UTF-8
export LANG=en_CA.UTF-8
export LANGUAGE=en
to no avail. I also tried using locale-gen to generate en-CA only. I also noticed that the Firefox file selection dialogue is also in Chinese.

Every setting page I can find says my locale is en-CA or en-US (which are both fine). Can anyone help me fix this?


I am on Manjaro Linux 23.0.1 KDE Edition

Last edited by Enderbyte09; 10-08-2023 at 09:16 PM. Reason: Add OS
 
Old 10-09-2023, 03:23 AM   #2
lvm_
Member
 
Registered: Jul 2020
Posts: 974

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
I vaguely remember having a similar calamity, and I *think* I fixed it by setting the variables in /etc/default/locale and rebooting.
 
Old 10-09-2023, 03:55 AM   #3
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,018

Rep: Reputation: 7342Reputation: 7342Reputation: 7342Reputation: 7342Reputation: 7342Reputation: 7342Reputation: 7342Reputation: 7342Reputation: 7342Reputation: 7342Reputation: 7342
Yes, I think bash startup profile is not the right location for it. But I think if you could add a second locale you can revert it too.
 
Old 10-09-2023, 10:13 AM   #4
Enderbyte09
LQ Newbie
 
Registered: Jun 2023
Location: Vancouver, Canada
Distribution: Manjaro KDE Edition, Kubuntu, WSL, Raspberry Pi OS
Posts: 6

Original Poster
Rep: Reputation: 0
Smile Found a fix for one of the issues

I found that I can fix the command output language by running
Code:
export LANGUAGE=en_CA.UTF-8
. However, some selection dialogues and notifications are still in Chinese. Oh well. It will improve my learning...
 
Old 10-09-2023, 02:06 PM   #5
MadeInGermany
Senior Member
 
Registered: Dec 2011
Location: Simplicity
Posts: 2,821

Rep: Reputation: 1212Reputation: 1212Reputation: 1212Reputation: 1212Reputation: 1212Reputation: 1212Reputation: 1212Reputation: 1212Reputation: 1212
Yes, you should not mix UTF-8 and non-UTF-8 locales!

LANG is legacy. The new one is LC_ALL. Both will also set the LC_* components.
Check with the command

Code:
locale
LANGUAGE is new to me...

Also try /etc/locale.conf
and the command

Code:
localectl
 
Old 10-09-2023, 06:46 PM   #6
Enderbyte09
LQ Newbie
 
Registered: Jun 2023
Location: Vancouver, Canada
Distribution: Manjaro KDE Edition, Kubuntu, WSL, Raspberry Pi OS
Posts: 6

Original Poster
Rep: Reputation: 0
Talking Fixed everything (seemingly) thanks to localepurge

I fixed what seems to be the last issues by running localepurge to clear out everything except English.

Thank you so much for your help!
 
  


Reply

Tags
command line, locale, locales



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
cannot lock locale archive "/usr/lib64/locale/locale-archive": Permission denied when building Multilib Cross Linux from Scratch Gunnersky2002 Linux - Software 2 06-13-2018 09:28 AM
How to capture 1000 lines before a string match and 1000 line a string match including line of string match ? sysmicuser Linux - Newbie 12 11-14-2017 05:21 AM
Locale: how to make terminal commands output in my locale? dedec0 Linux - Software 19 10-17-2017 06:25 AM
"locale not supported by Xlib, locale set to C" Irad Linux - Software 3 06-25-2006 03:59 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:40 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration