You are not logged in.
I wasn't completely happy with all of the formats of any given locale, so I created my own.
If follows ISO and POSIX standards where applicable. Check the project page for more information.
I've been using it for half a year on my main system without any issues.
Last edited by Xyne (2012-12-02 17:20:33)
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
*sweeps off some dust*
*coughs*
Just in case anyone is using this, I have changed the package name to "locale-en_xx". I just noticed today that it hadn't been uploaded to the AUR because of the upper-case letters in the old name. Oops. (There is now an AUR package for those that don't use my repo).
I have also made a slight modification to the '%c' format too. See the changelog on the project page or in the source archive for details.
If someone wants to contribute an updated version of the deb package, feel free.
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
If anyone has an XKCD forum account, feel free to mention this locale here.
(not entirely) shameless self-bump (it's a good locale, damn it)
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
It's indeed a good locale. Thanks!
I've been looking for something like this for *years*.
Offline
It's indeed a good locale. Thanks!
I've been looking for something like this for *years*.
spread the word
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
I've lately been experimenting with a custom locale myself and had the same problems with urxvt you had in the past. I think I found the reason, why one has to set the LC_CTYPE to en_US.UTF-8.
Xlib uses LC_CTYPE as the current locale. See 13.1 here. It also keeps a file (/usr/share/X11/locale/locale.dir) with the locales it supports. It uses this file to determine which locale definitions in /usr/share/X11/locale to use. For most it is simply en_US.UTF-8.
I tried adding an entry for my locale, namely "en_US.UTF-8/XLC_LOCALE: en_FB.UTF-8", and everything works as expected, without any error...
So the reason, why it doesn't help, to copy en_US or what ever in your locale definition, is that Xlib doesn't actually care or look at the definitions you made, but only looks at the current value of LC_CTYPE and makes a lookup in its own database.
Edit: Fix locale entry see post below as well.
Last edited by DerFlob (2013-07-05 09:11:48)
Offline
Thanks for posting the explanation and solution. I have updated the en_XX README.
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
I just realized, the entry you have to add should have read "en_US.UTF-8/XLC_LOCALE: en_XX.UTF-8". In addition to this entry you also need an entry, that doesn't have the colon i.e. "en_US.UTF-8/XLC_LOCALE en_XX.UTF-8".
I haven't used it so far, but for multi-key input sequences to work, you probably have to add entries to /usr/share/X11/locale/compose.dir as well. "en_US.UTF-8/Compose: en_XX.UTF-8", again once with, once without the colon.
Sorry about the previous incomplete post... I didn't realize at the time, the difference between the entries. I just thought they were exact duplicates ._.
Edit: typo
Last edited by DerFlob (2013-07-05 18:23:25)
Offline
I noticed that the file contained multiple entries with "/XLC_LOCALE" but I assumed they were unnecessary as I thought it worked for you. I'll update the README again. Thanks for taking the time to post a follow-up. Incidentally, there is a missing "-8" in the entry at the end of the first line.
It's nice to finally have the solution to this but in the end I think that setting LC_CTYPE to en_US.UTF-8 in /etc/locale.conf the better solution (few files, more "central").
Let me know if you find a way to get people to actually use your locale.
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
Thank you for this locale. Since I don't want to use it as my default locale but like it when I need to parse data in pipes, I have added an alias to /usr/share/locale/locale.alias:
CUTF en_XX.UTF-8@POSIX
Now I can simply use this way:
LANG=CUTF date
I just wish that such a locale would be included in all major linux distributions by default. C/POSIX is just not enough anymore.
| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |
Offline
Great locale, thanks!
I notice, however, that immediately upon my very first installation of the locale-en_xx package, I get this:
$ man
man: can't set the locale; make sure $LC_* and $LANG are correct
What manual page do you want?
$
The output of the locale command is:
$ locale
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_XX.UTF-8@POSIX
LC_CTYPE=en_US.UTF-8
LC_NUMERIC="en_XX.UTF-8@POSIX"
LC_TIME="en_XX.UTF-8@POSIX"
LC_COLLATE="en_XX.UTF-8@POSIX"
LC_MONETARY="en_XX.UTF-8@POSIX"
LC_MESSAGES="en_XX.UTF-8@POSIX"
LC_PAPER="en_XX.UTF-8@POSIX"
LC_NAME="en_XX.UTF-8@POSIX"
LC_ADDRESS="en_XX.UTF-8@POSIX"
LC_TELEPHONE="en_XX.UTF-8@POSIX"
LC_MEASUREMENT="en_XX.UTF-8@POSIX"
LC_IDENTIFICATION="en_XX.UTF-8@POSIX"
LC_ALL=
$
I have tried both the LC_CTYPE and Xlib approaches from the package homepage, but no success
Any ideas what's the problem and how to fix it?
Offline
Post the output of 'locale -a' and 'localectl'.
Offline
$ locale -a
locale: Cannot set LC_CTYPE to default locale: No such file or directory
C
en_XX@POSIX
en_XX.utf8@POSIX
POSIX
$ localectl
System Locale: LANG=en_XX.UTF-8@POSIX
LC_CTYPE=en_US.UTF-8
VC Keymap: us
X11 Layout: n/a
Offline
If you're going to use LC_*=bar, you have to make sure bar is available i.e. uncomment en_US.UTF-8 locale in /etc/locale.gen and regenerate the locales. Check the output of 'locale -a' to see if en_US.UTF-8 is now available.
Offline
That solved the problem. Thank you.
Offline
It's not mentioned in http://xyne.archlinux.ca/projects/locale-en_xx/ , not sure if it needs to be. If you thought that only 'en_XX.UTF-8@POSIX UTF-8' needs to be enabled in /etc/locale.gen then I guess explicitly saying you need 'en_US.UTF-8' wouldn't hurt.
Offline
I have updated the README. Thanks for the suggestion.
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
I use the alternative way with patches to locale.dir and compose.dir. I have also added an alias for LANG=CUTF, and everything is managed with the following script I run if necessary.
#!/usr/bin/bash
testwrite() {
echo "Test '$2' in '$3'"
if ! grep -a "$1" "$3" ; then
echo Write
echo "$2" >> "$3"
fi
echo
}
new_entry="CUTF en_XX@POSIX"
test_pattern='^CUTF[[:space:]]'
target_file=/usr/share/locale/locale.alias
testwrite "$test_pattern" "$new_entry" "$target_file"
target_file=/usr/share/X11/locale/locale.alias
testwrite "$test_pattern" "$new_entry" "$target_file"
new_entry="CUTF: en_XX@POSIX"
test_pattern='^CUTF:[[:space:]]'
target_file=/usr/share/X11/locale/locale.alias
testwrite "$test_pattern" "$new_entry" "$target_file"
test_pattern='^en_US\.UTF-8/XLC_LOCALE:[[:space:]]\+en_XX\.UTF-8'
new_entry='en_US.UTF-8/XLC_LOCALE: en_XX.UTF-8'
target_file='/usr/share/X11/locale/locale.dir'
testwrite "$test_pattern" "$new_entry" "$target_file"
test_pattern='^en_US\.UTF-8/XLC_LOCALE[[:space:]]\+en_XX\.UTF-8'
new_entry='en_US.UTF-8/XLC_LOCALE en_XX.UTF-8'
target_file='/usr/share/X11/locale/locale.dir'
testwrite "$test_pattern" "$new_entry" "$target_file"
test_pattern='^en_US\.UTF-8/Compose:[[:space:]]\+en_XX\.UTF-8'
new_entry='en_US.UTF-8/Compose: en_XX.UTF-8'
target_file='/usr/share/X11/locale/compose.dir'
testwrite "$test_pattern" "$new_entry" "$target_file"
test_pattern='^en_US\.UTF-8/Compose[[:space:]]\+en_XX\.UTF-8'
new_entry='en_US.UTF-8/Compose en_XX.UTF-8'
target_file='/usr/share/X11/locale/compose.dir'
testwrite "$test_pattern" "$new_entry" "$target_file"
| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |
Offline
The latest upgrade fixes a longstanding error that led to "unrecognized locale" errors (due to a misunderstanding when I create the locale years ago).
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline