en_CH locale
English may not be one of the official Swiss languages (yet?), but it is certainly useful in a computer system. I don't want server logs and error messages in French or German or Italian (or Romantsch?). These things are easiest to understand and get help about in English. But I don't want dates in the confusing US "MM/DD/YY" format either, or times in AM/PM. Most importantly: I want sorting to work correctly with accented letters, and I want Perl to understand accented letters for
So I made my own en_CH locale. Tested it in Debian stable (3.1 "Sarge"), and it seems to do what I expected. If you want to try it out, the steps are below. And it is quite easy to edit language_COUNTRY files to suit your needs.
At your next login, your locale should be set to en_CH, and these little tests should work:
Update: For Ubuntu 6.10 ("Edgy"), see also this post in this ubuntu forum thread!
\w
, the uc()
, lc()
functions, etc.So I made my own en_CH locale. Tested it in Debian stable (3.1 "Sarge"), and it seems to do what I expected. If you want to try it out, the steps are below. And it is quite easy to edit language_COUNTRY files to suit your needs.
# cp /usr/share/i18n/SUPPORTED /usr/share/i18n/SUPPORTED.origYou may also need to edit your
# echo -e "en_CH ISO-8859-1\nen_CH.UTF-8 UTF-8" | sort - /usr/share/i18n/SUPPORTED.orig >/usr/share/i18n/SUPPORTED
# wget -O /usr/share/i18n/locales/en_CH http://alma.ch/linux/en_CH
# echo "en_CH ISO-8859-1" >>/etc/locale.gen
# echo "en_CH.UTF-8 UTF-8" >>/etc/locale.gen
# dpkg-reconfigure locales
/etc/environment
file and/or /etc/default/locale
if they have a left-over LANGUAGE= line.At your next login, your locale should be set to en_CH, and these little tests should work:
$ echo -e "é\ne\nA\nà\nE" |sort(Note that for Perl, you need
$ perl -Mlocale -e 'print "Uppercase accented é and à: ", uc("éà\n")'
$ echo -e "é\ne\nA\nà\nE" |perl -Mlocale -ne 'while (/(\w+)/g) {print "$1\n"}'
use locale;
).Update: For Ubuntu 6.10 ("Edgy"), see also this post in this ubuntu forum thread!
2 Comments:
Thanks a lot! On Ubuntu 14.04, I ran `locale-gen en_CH.UTF-8` instead of listing it in `/etc/locale.gen` which I think is not used anymore.
This comment has been removed by the author.
Post a Comment
<< Home