View previous topic :: View next topic |
Author |
Message |
curmudgeon Veteran
Joined: 08 Aug 2003 Posts: 1744
|
Posted: Mon Jun 03, 2019 5:08 am Post subject: Where do I find en_SE.UTF-8? |
|
|
Not sure whether this goes here or in Desktop Environments (as Plasma seems involved). I absolutely detest the short date format for my locale with every fiber of my being (I am not using en_US.UTF-8 as the output below shows, but something even worse). So looking through (in Plasma) System Settings / Regional Settings / Numeric, Currency and Time Formats, I notice that (for time) en_SE shows dates and times exactly how I would like them displayed, so I made that my time setting.
On next login, however, when running a perl script, I see:
Code: |
$ /path/to/some/perl.pl
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = "",
LC_ALL = (unset),
LC_COLLATE = "POSIX",
LC_TIME = "en_SE.UTF-8",
LANG = "en_US.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_US.UTF-8".
|
So, I looked in /etc/locale.gen, added "en_SE.UTF-8 UTF-8", and ran locale.gen.
Code: |
# locale-gen
* Generating 7 locales (this might take a while) with 4 jobs
* (3/7) Generating en_SE.UTF-8 ...
failed to set locale!
[error] cannot open locale definition file `en_SE': No such file or directory [ !! ]
[...]
* Generation complete
* Adding locales to archive ...
incomplete set of locale files in "//usr/lib64/locale/en_SE.utf8" [ !! ]
|
Further reading the man page, I looked in /usr/share/i18n/locales/, and sure enough, it doesn't exist.
Code: |
$ ls -al /usr/share/i18n/locales/
[...]
-rw-r--r-- 1 root root 4638 2019-05-05 10:16:01 en_PH
-rw-r--r-- 1 root root 2548 2019-05-05 10:16:01 en_SC
-rw-r--r-- 1 root root 4464 2019-05-05 10:16:01 en_SG
-rw-r--r-- 1 root root 3368 2019-05-05 10:16:01 en_US
[...]
|
I always edit all of the locale files in localedata that I might use (every time I compile glibc) to reflect what I want, but that doesn't "fix" Plasma applications. And I don't want endless warnings in a shell, because I actually do most of my work at the command line. So where do I find en_SE.UTF-8 to include it in glibc (already using a relatively recent 2.28-r6), or does some other way exist to get glibc and Plasma to work together? |
|
Back to top |
|
|
charles17 Advocate
Joined: 02 Mar 2008 Posts: 3684
|
|
Back to top |
|
|
ChadJoan n00b
Joined: 17 Oct 2010 Posts: 38
|
Posted: Tue Jan 10, 2023 10:42 pm Post subject: |
|
|
I was just bringing up a new system and had the same issue as the OP.
It seems that Gentoo's stage3 doesn't have this file:
Code: | /usr/share/i18n/locales/en_SE |
But a previous computer of mine, with working en_SE locale, does have this file!
So let's look at the state of affairs on my old computer:
Code: |
# equery belongs /usr/share/i18n/locales/en_US
* Searching for /usr/share/i18n/locales/en_US ...
sys-libs/glibc-2.32-r5 (/usr/share/i18n/locales/en_US)
# equery belongs /usr/share/i18n/locales/en_SE
* Searching for /usr/share/i18n/locales/en_SE ...
#
|
Note that I looked into en_US first to get a baseline. Anyhow, interesting results. It seems en_SE isn't claimed by any package at this time. If I didn't get it from somewhere else, perhaps it came from an older version of glibc and then was phased out at some point? *shrug* I can only speculate. I definitely can't remember.
But.
Because I have an en_SE file, I can use that. So I copied it over to the new machine. And it worked!
So, for any reader in the future who encounters this problem and needs a solution, even if it's a bit unconventional, here are the contents of my working `/usr/share/i18n/locales/en_SE` file:
https://pastebin.com/HrSFwZWp
The file's timestamp is 2018-05-22.
Once I had copied that file into the same path on my new machine, I ran `locale-gen` again, and got this output:
Code: |
# locale-gen
* Generating 5 locales (this might take a while) with 56 jobs
* (5/5) Generating C.UTF-8 ... [ ok ]
* (3/5) Generating ja_JP.UTF-8 ... [ ok ]
* (2/5) Generating en_US.UTF-8 ... [ ok ]
* (1/5) Generating en_SE.UTF-8 ... [ ok ]
* (4/5) Generating zh_CN.UTF-8 ... [ ok ]
* Generation complete
* Adding locales to archive ... [ ok ]
# locale -a
C
C.utf8
POSIX
en_SE.utf8
en_US.utf8
ja_JP.utf8
zh_CN.utf8
|
Success!
Now, I haven't tested this in any other way. The system isn't running yet at the time I am writing this post. So there might be caveats, unforeseen consequences that I haven't encountered yet. But I wanted to publish what I had before I forget about it. (Also these locale files look self-contained enough, so I suspect this will be fine.) |
|
Back to top |
|
|
hallthor n00b
Joined: 30 Jan 2024 Posts: 1
|
Posted: Tue Jan 30, 2024 7:36 pm Post subject: |
|
|
ChadJoan wrote: | I was just bringing up a new system and had the same issue as the OP.
It seems that Gentoo's stage3 doesn't have this file:
Code: | /usr/share/i18n/locales/en_SE |
|
Just finished a basic install and ran into the same issue.
I don't really know how I ended up having en_SE in my locale (locale really messes with me every time) but it does not exit in /usr/share/i18n/locales
Quote: |
So, for any reader in the future who encounters this problem and needs a solution, even if it's a bit unconventional, here are the contents of my working `/usr/share/i18n/locales/en_SE` file:
https://pastebin.com/HrSFwZWp
|
couldn't access your pastebin - maybe this is worth a bug report and you could provide your en-SE file there? |
|
Back to top |
|
|
cgorichanaz n00b
Joined: 12 Mar 2024 Posts: 1
|
Posted: Tue Mar 12, 2024 7:25 am Post subject: |
|
|
I ran into this recently as well, and found a good explanation of how to work around this at https://pig-monkey.com/2024/02/things-i-do-for-time/
Something like:
Code: |
$ sudo ln -s /usr/share/i18n/locales/en_DK /usr/share/i18n/locales/en_SE
$ echo 'en_SE.UTF-8 UTF-8' | sudo tee -a /etc/locale.gen
$ sudo locale-gen
$ sed -i 's/^LC_TIME=.*/LC_TIME=en_SE.UTF-8/' /etc/locale.conf
|
|
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|