Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How to get Danish keyboard with en_DK locale [solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
Leo Laursen
n00b
n00b


Joined: 29 Mar 2012
Posts: 38

PostPosted: Tue Oct 02, 2012 6:57 am    Post subject: How to get Danish keyboard with en_DK locale [solved] Reply with quote

I'm frequently annoyed with Danish translations, so I decided to try the locale en_DK.utf-8.
When X starts, I get an English keyboard layout.
No problem , I think; setxkbmap to the rescue.
~/.xinitrc wrote:
setxkbmap -layout dk

This does give me Danish keyboard layout, but with a lot of letters missing and no deadkeys and no compose key.
Okayyyy, let's try xmodmap.
xmodmap -pke | grep -i aring (the Danish letter å) wrote:

keycode 34 = aring Aring aring Aring dead_diaeresis dead_abovering dead_diaeresis

so why won't it show?
xev wrote:
KeyPress event, serial 32, synthetic NO, window 0x1800001,
root 0x174, subw 0x0, time 1934060, (493,-112), root:(1457,440),
state 0x0, keycode 34 (keysym 0xe5, aring), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False

/etc/X11/xorg.conf.d/10-evdev.conf wrote:

Section "InputClass"
Identifier "evdev keyboard catchall"
MatchIsKeyboard "on"
MatchDevicePath "/dev/input/event*"
Driver "evdev"
Option "XkbLayout" "dk"
Option "XkbModel" "logicd"
Option "XkbOptions" "compose:rctrl,eurosign:e"
EndSection

With locale da_DK.utf-8 everything works.
I'm using autologin, with systemd running startx; but it also happens when I try gdm.


Last edited by Leo Laursen on Wed Oct 03, 2012 10:16 am; edited 1 time in total
Back to top
View user's profile Send private message
Leo Laursen
n00b
n00b


Joined: 29 Mar 2012
Posts: 38

PostPosted: Tue Oct 02, 2012 7:17 pm    Post subject: Reply with quote

It seems that, although glibc supports the locale en_DK, libX11 doesn't.
I found two suggestions:

[*] Use LANG=da_DK.utf8 & LC_MESSAGES=en_US.utf8
[*] Use LANG=en_DK.utf8 & LC_CTYPES=en_US.utf8

I'm going to experiment with those tomorrow.

It would be so much nicer if one could just use eselect locale.
Now I have to fiddle, and worse - remember where I did it.
By the way; is /etc/locale.conf not used any more?

Edit: both suggestions work, but the second is the most consistent imo.
I added this to /etc/profile
Code:

if [ "${LANG}" = "en_DK.utf8" ] ; then
  export LC_CTYPE="en_US.utf8"
fi
Back to top
View user's profile Send private message
Leo Laursen
n00b
n00b


Joined: 29 Mar 2012
Posts: 38

PostPosted: Thu Oct 04, 2012 7:52 pm    Post subject: Reply with quote

I only recently found out about that brilliant concept of user patches,
and decided that it would present a much cleaner solution.
Here is my /etc/portage/patches/x11-libs/libX11/libX11-en_DK.patch,
in case that others want to us the locale en_DK.
Code:
diff -urN libX11-1.5.0/nls/compose.dir.pre libX11-1.5.0.new/nls/compose.dir.pre
--- libX11-1.5.0/nls/compose.dir.pre   2012-06-02 08:37:18.000000000 +0200
+++ libX11-1.5.0.new/nls/compose.dir.pre   2012-10-04 21:20:07.182686591 +0200
@@ -58,6 +58,8 @@
 iso8859-1/Compose:      en_AU.ISO8859-1
 iso8859-1/Compose:      en_BZ.ISO8859-1
 iso8859-1/Compose:      en_CA.ISO8859-1
+iso8859-1/Compose:      en_DK.ISO8859-1
+iso8859-15/Compose:      en_DK.ISO8859-15
 iso8859-1/Compose:      en_GB.ISO8859-1
 iso8859-15/Compose:      en_GB.ISO8859-15
 iso8859-1/Compose:      en_IE.ISO8859-1
@@ -281,6 +283,7 @@
 en_US.UTF-8/Compose:      en_AU.UTF-8
 en_US.UTF-8/Compose:      en_BZ.UTF-8
 en_US.UTF-8/Compose:      en_CA.UTF-8
+en_US.UTF-8/Compose:      en_DK.UTF-8
 en_US.UTF-8/Compose:      en_GB.UTF-8
 en_US.UTF-8/Compose:      en_IE.UTF-8
 en_US.UTF-8/Compose:      en_JM.UTF-8
diff -urN libX11-1.5.0/nls/locale.alias.pre libX11-1.5.0.new/nls/locale.alias.pre
--- libX11-1.5.0/nls/locale.alias.pre   2012-06-02 08:37:18.000000000 +0200
+++ libX11-1.5.0.new/nls/locale.alias.pre   2012-10-04 21:13:10.115593786 +0200
@@ -304,6 +304,17 @@
 en_CA.ISO-8859-1:            en_CA.ISO8859-1
 en_CA.ISO_8859-1:            en_CA.ISO8859-1
 en_CA.utf8:               en_CA.UTF-8
+en_DK:                  en_DK.ISO8859-1
+EN_DK:                  en_DK.ISO8859-1
+en_DK.88591:               en_DK.ISO8859-1
+en_DK.iso88591:               en_DK.ISO8859-1
+en_DK.ISO-8859-1:            en_DK.ISO8859-1
+en_DK.ISO_8859-1:            en_DK.ISO8859-1
+en_DK.iso885915:            en_DK.ISO8859-15
+en_DK.ISO-8859-15:            en_DK.ISO8859-15
+en_DK.8859-15:               en_DK.ISO8859-15
+en_DK.utf8:               en_DK.UTF-8
+EN_DK.UTF-8:               en_DK.UTF-8
 en_GB:                  en_GB.ISO8859-1
 en_GB.88591:               en_GB.ISO8859-1
 en_GB.88591.en:               en_GB.ISO8859-1
diff -urN libX11-1.5.0/nls/locale.dir.pre libX11-1.5.0.new/nls/locale.dir.pre
--- libX11-1.5.0/nls/locale.dir.pre   2012-06-02 08:37:18.000000000 +0200
+++ libX11-1.5.0.new/nls/locale.dir.pre   2012-10-04 21:16:18.594640229 +0200
@@ -68,6 +68,8 @@
 iso8859-1/XLC_LOCALE:         en_BZ.ISO8859-1
 iso8859-1/XLC_LOCALE:         en_BW.ISO8859-1
 iso8859-1/XLC_LOCALE:         en_CA.ISO8859-1
+iso8859-1/XLC_LOCALE:         en_DK.ISO8859-1
+iso8859-15/XLC_LOCALE:         en_DK.ISO8859-15
 iso8859-1/XLC_LOCALE:         en_GB.ISO8859-1
 iso8859-15/XLC_LOCALE:         en_GB.ISO8859-15
 iso8859-1/XLC_LOCALE:         en_HK.ISO8859-1
@@ -301,6 +303,7 @@
 en_US.UTF-8/XLC_LOCALE:         en_BE.UTF-8
 en_US.UTF-8/XLC_LOCALE:         en_BZ.UTF-8
 en_US.UTF-8/XLC_LOCALE:         en_CA.UTF-8
+en_US.UTF-8/XLC_LOCALE:         en_DK.UTF-8
 en_US.UTF-8/XLC_LOCALE:         en_GB.UTF-8
 en_US.UTF-8/XLC_LOCALE:         en_IE.UTF-8
 en_US.UTF-8/XLC_LOCALE:         en_JM.UTF-8
Back to top
View user's profile Send private message
Isomorph
n00b
n00b


Joined: 22 Sep 2002
Posts: 55
Location: Denmark

PostPosted: Wed Oct 17, 2012 3:05 pm    Post subject: Reply with quote

I get an error when I trying to apply the patch.


Here is the first of the libX11-en_DK.patch.out file.
Code:

***** libX11-en_DK.patch *****
PWD: /var/tmp/portage/x11-libs/libX11-1.5.0/work/libX11-1.5.0

==============================

PATCH COMMAND:  patch -p0 -g0 -E --no-backup-if-mismatch  < '/etc/portage/patches//x11-libs/libX
11/libX11-en_DK.patch'

==============================
can't find file to patch at input line 4
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -urN libX11-1.5.0/nls/compose.dir.pre libX11-1.5.0.new/nls/compose.dir.pre
|--- libX11-1.5.0/nls/compose.dir.pre   2012-06-02 08:37:18.000000000 +0200
|+++ libX11-1.5.0.new/nls/compose.dir.pre   2012-10-04 21:20:07.182686591 +0200
--------------------------
No file to patch.  Skipping patch.
2 out of 2 hunks ignored
can't find file to patch at input line 24
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -urN libX11-1.5.0/nls/locale.alias.pre libX11-1.5.0.new/nls/locale.alias.pre
|--- libX11-1.5.0/nls/locale.alias.pre   2012-06-02 08:37:18.000000000 +0200
|+++ libX11-1.5.0.new/nls/locale.alias.pre   2012-10-04 21:13:10.115593786 +0200
--------------------------
No file to patch.  Skipping patch.
1 out of 1 hunk ignored
can't find file to patch at input line 45
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
Back to top
View user's profile Send private message
Leo Laursen
n00b
n00b


Joined: 29 Mar 2012
Posts: 38

PostPosted: Wed Oct 17, 2012 5:20 pm    Post subject: Reply with quote

Isomorph wrote:
I get an error when I trying to apply the patch.

It patches fine for me. Maybe it's a copy paste problem.
You could try my patch on Dropbox (public)
Back to top
View user's profile Send private message
Isomorph
n00b
n00b


Joined: 22 Sep 2002
Posts: 55
Location: Denmark

PostPosted: Mon Oct 29, 2012 3:34 pm    Post subject: Reply with quote

I fixed the problem, something about that I needed to make the patch
from a directory deeper down.
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Mon Oct 29, 2012 5:06 pm    Post subject: Reply with quote

Isomorph wrote:
I fixed the problem, something about that I needed to make the patch
from a directory deeper down.

Isomorph ... the '-p{N}' (prefix), or '--strip={N}' passed (-p0) means that no part of the path is stripped when atempting to apply the patch. So, from the directory in which the patch is applied it will look to applying in 'libX11-1.5.0/nls/' but as your (probably) in libX11-1.5.0/ a '-p1' was needed to strip that part of the path from the patch.

best ... khay
Back to top
View user's profile Send private message
Isomorph
n00b
n00b


Joined: 22 Sep 2002
Posts: 55
Location: Denmark

PostPosted: Wed Dec 19, 2012 3:43 am    Post subject: Reply with quote

I still have this in my bootup messages(from /var/log/rc.log), did you guys solve that too.

Code:

/bin/sh: warning: setlocale: LC_ALL: cannot change locale (en_DK.UTF-8)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
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