You are not logged in.
Pages: 1
I'm having some trouble with the locale of my system. I've got
en_US.UTF-8 UTF-8uncommented in /etc/locale.gen. It also show's up in the list when I run
locale -a. I don't have a ~/.config/locale.conf file and my /etc/locale.conf has a single line:
LANG=en_US.UTF-8and I also have
LANG="en_US.UTF-8"in /etc/environment. But yet, when I run
localeI get this list:
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=sma_SE.US-ASCII
LC_CTYPE="sma_SE.US-ASCII"
LC_NUMERIC="sma_SE.US-ASCII"
LC_TIME="sma_SE.US-ASCII"
LC_COLLATE="sma_SE.US-ASCII"
LC_MONETARY="sma_SE.US-ASCII"
LC_MESSAGES="sma_SE.US-ASCII"
LC_PAPER="sma_SE.US-ASCII"
LC_NAME="sma_SE.US-ASCII"
LC_ADDRESS="sma_SE.US-ASCII"
LC_TELEPHONE="sma_SE.US-ASCII"
LC_MEASUREMENT="sma_SE.US-ASCII"
LC_IDENTIFICATION="sma_SE.US-ASCII"
LC_ALL=I've set numeric, currency and time formats to Swedish in the KDE System Settings. But not LANG.
The actual problem I get from this are three, this far:
Characters that are not ASCII shows as question marks in the terminal
When I try to run the program Anki I get the error
Exception: Anki requires a UTF-8 locale.When I try to run the program zim, I get the error
locale.Error: unsupported locale settingI've found some others with the same problem with Anki in various places on the internet but the solutions haven't worked for me. By entering
export LC_ALL="en_US.UTF-8"as suggested in the top answer here I can run Anki and zim from that terminal but it only works temporarily. I can also use
export LANG="en_US.UTF-8"and get the same result.
I guess my question boils down to: how do I change the LANG locale when it seems that the usual ways don't work?
Last edited by SimonT (2017-10-05 20:40:06)
Offline
Did you run below command after changes in /etc/locale.gen?
locale-genOffline
Yes
Offline
"sma_SE.US-ASCII" is no valid locale
Check the locale in a linux console (ctrl+alt+f1) - if it's ok there, it's something your session does.
For plasma,
grep -r sma_SE ~/.config/plasma*In doubt, grep your entire home directory ...
Online
I get a the right LANG if I press ctrl+alt+f2 and run the locale command.
I get two results when I search for sma_SE:
/home/<username>/.config/plasma-locale-settings.sh:export LANG=sma_SE.US-ASCII
/home/<username>/.config/plasma-localerc:LANG=sma_SE.US-ASCIIplasma-locale-settings.sh contains:
# Generated script, do not edit
# Exports language-format specific env vars from startkde.
# This script has been generated from kcmshell5 formats.
# It will automatically be overwritten from there.
export LANG=sma_SE.US-ASCIII found I had the wrong kind of Swedish in the system settings. I changed it there and then the file showed sv_SE.UTF-8 as it should. I also went to the language settings in KDE and set it to American English. I had that before and it didn't change anything though.
plasma-localerc contains
[Formats]
LANG=sma_SE.US-ASCII
[Translations]
LANGUAGE=I changed both of them to en_US.UTF-8. I don't know why it says [Formats] above LANG when what it does is to change the language, not the formats. Anyway, I logged out and logged back in and now it's working. Thanks Seth!
Offline
Please remember to mark your thread as [Solved] by editing your first post and prepending it to the title.
Offline
Pages: 1