installer.kmdr: fixes for language and locale settings; drop support; drop support for /etc/sysconfig/{i18n,keyboard}
This commit is contained in:
parent
460230742e
commit
10067eb5b0
@ -953,8 +953,7 @@ if [ -r ~/.kde4/share/config/kdeglobals ]; then
|
|||||||
*) LANGUAGE="${Language}" ;;
|
*) LANGUAGE="${Language}" ;;
|
||||||
esac
|
esac
|
||||||
LANGUAGE=${LANGUAGE:0:5}.UTF-8
|
LANGUAGE=${LANGUAGE:0:5}.UTF-8
|
||||||
sed -i "s|LANG=.*|LANG=$LANGUAGE|" /etc/sysconfig/i18n
|
sudo sed -i "s|LANG=.*|LANG=$LANGUAGE|" /etc/locale.conf
|
||||||
sed -i "s|LANG=.*|LANG=$LANGUAGE|" /etc/locale.conf
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@execEnd
|
@execEnd
|
||||||
@ -977,8 +976,7 @@ fi
|
|||||||
</property>
|
</property>
|
||||||
<property name="associations" stdset="0">
|
<property name="associations" stdset="0">
|
||||||
<stringlist>
|
<stringlist>
|
||||||
<string>. /etc/sysconfig/i18n
|
<string>LANGUAGE="$LANG"
|
||||||
LANGUAGE="$LANG"
|
|
||||||
if [ -r ~/.kde4/share/config/kdeglobals ]; then
|
if [ -r ~/.kde4/share/config/kdeglobals ]; then
|
||||||
eval `grep -i Country ~/.kde4/share/config/kdeglobals`
|
eval `grep -i Country ~/.kde4/share/config/kdeglobals`
|
||||||
# find country definition in selected language
|
# find country definition in selected language
|
||||||
@ -1000,6 +998,7 @@ fi
|
|||||||
case ${LANGUAGE:0:5} in
|
case ${LANGUAGE:0:5} in
|
||||||
en_*) LANGUAGE="English (${LANGUAGE:3:2})" ;;
|
en_*) LANGUAGE="English (${LANGUAGE:3:2})" ;;
|
||||||
es_*) LANGUAGE="Español" ;;
|
es_*) LANGUAGE="Español" ;;
|
||||||
|
fr_*) LANGUAGE="Français" ;;
|
||||||
it_IT) LANGUAGE="Italiano" ;;
|
it_IT) LANGUAGE="Italiano" ;;
|
||||||
it_CH) LANGUAGE="Italiano (CH)" ;;
|
it_CH) LANGUAGE="Italiano (CH)" ;;
|
||||||
*) LANGUAGE="${LANGUAGE:0:2}" ;;
|
*) LANGUAGE="${LANGUAGE:0:2}" ;;
|
||||||
@ -1139,17 +1138,14 @@ dcop @dcopid KommanderIf setText countrylabel $"$COUNTRY"
|
|||||||
<stringlist>
|
<stringlist>
|
||||||
<string>LAYOUT_CURR="@kblayout_box.item(@kblayout_box.currentItem)"
|
<string>LAYOUT_CURR="@kblayout_box.item(@kblayout_box.currentItem)"
|
||||||
MODEL_CURR="@kbgeometry_box.item(@kbgeometry_box.currentItem)"
|
MODEL_CURR="@kbgeometry_box.item(@kbgeometry_box.currentItem)"
|
||||||
LAYOUT=`awk '/! layout/,/$^/' /usr/share/X11/xkb/rules/base.lst | grep "$LAYOUT_CURR" | awk '{print $1}'`
|
LAYOUT=`awk '/! layout/,/$^/' /usr/share/X11/xkb/rules/base.lst | grep " $LAYOUT_CURR$" | awk '{print $1}'`
|
||||||
MODEL=`awk '/! model/,/$^/' /usr/share/X11/xkb/rules/base.lst | grep "$MODEL_CURR" | awk '{print $1}'`
|
MODEL=`awk '/! model/,/$^/' /usr/share/X11/xkb/rules/base.lst | grep " $MODEL_CURR$" | awk '{print $1}'`
|
||||||
setxkbmap -layout $LAYOUT -model $MODEL
|
setxkbmap -layout $LAYOUT -model $MODEL
|
||||||
sed -i "s|\(KEYMAP=\).*|\1$LAYOUT.map|" /etc/sysconfig/keyboard
|
sudo sed -i "s|\(\"XkbLayout\"\).*|\1 \"$LAYOUT\"|" /etc/X11/xorg.conf
|
||||||
sed -i "s|\(XKB_LAYOUT=\).*|\1$LAYOUT|" /etc/sysconfig/keyboard
|
sudo sed -i "s|\(\"XkbModel\"\).*|\1 \"$MODEL\"|" /etc/X11/xorg.conf
|
||||||
sed -i "s|\(XKB_MODEL=\).*|\1$MODEL|" /etc/sysconfig/keyboard
|
sudo sed -i "s|\(\"XkbLayout\"\).*|\1 \"$LAYOUT\"|" /etc/X11/xorg.conf.d/10-keyboard.conf
|
||||||
sed -i "s|\(\"XkbLayout\"\).*|\1 \"$LAYOUT\"|" /etc/X11/xorg.conf
|
sudo sed -i "s|\(\"XkbModel\"\).*|\1 \"$MODEL\"|" /etc/X11/xorg.conf.d/10-keyboard.conf
|
||||||
sed -i "s|\(\"XkbModel\"\).*|\1 \"$MODEL\"|" /etc/X11/xorg.conf
|
sudo sed -i "s|\(KEYMAP=\).*|\1$LAYOUT|" /etc/vconsole.conf
|
||||||
sed -i "s|\(\"XkbLayout\"\).*|\1 \"$LAYOUT\"|" /etc/X11/xorg.conf.d/10-keyboard.conf
|
|
||||||
sed -i "s|\(\"XkbModel\"\).*|\1 \"$MODEL\"|" /etc/X11/xorg.conf.d/10-keyboard.conf
|
|
||||||
sed -i "s|\(KEYMAP=\).*|\1$LAYOUT|" /etc/vconsole.conf
|
|
||||||
</string>
|
</string>
|
||||||
</stringlist>
|
</stringlist>
|
||||||
</property>
|
</property>
|
||||||
@ -1170,12 +1166,12 @@ sed -i "s|\(KEYMAP=\).*|\1$LAYOUT|" /etc/vconsole.conf
|
|||||||
<stringlist>
|
<stringlist>
|
||||||
<string>@testEdit.setSelection(@testEdit.text)
|
<string>@testEdit.setSelection(@testEdit.text)
|
||||||
dcop @dcopid KommanderIf setBusyCursor true
|
dcop @dcopid KommanderIf setBusyCursor true
|
||||||
. /etc/sysconfig/keyboard
|
|
||||||
if [ ! "$XKB_LAYOUT" ]; then
|
if [ ! "$XKB_LAYOUT" ]; then
|
||||||
eval `grep "^LayoutList=" ~/.kde4/share/config/kxkbrc`
|
eval `grep "^LayoutList=" ~/.kde4/share/config/kxkbrc`
|
||||||
[ "$LayoutList" ] && \
|
[ "$LayoutList" ] && \
|
||||||
XKB_LAYOUT="${LayoutList/,*/}" || \
|
XKB_LAYOUT="${LayoutList/,*/}" || \
|
||||||
XKB_LAYOUT="us"
|
XKB_LAYOUT=`setxkbmap -print | awk -F"+" '/xkb_symbols/ { print $2}'`
|
||||||
|
[ "$XKB_LAYOUT" ] || XKB_LAYOUT="us"
|
||||||
fi
|
fi
|
||||||
awk '/! layout/,/$^/' /usr/share/X11/xkb/rules/base.lst | sort -k2 | \
|
awk '/! layout/,/$^/' /usr/share/X11/xkb/rules/base.lst | sort -k2 | \
|
||||||
while read id desc; do
|
while read id desc; do
|
||||||
@ -1185,6 +1181,13 @@ while read id desc; do
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if [ ! "$XKB_MODEL" ]; then
|
||||||
|
eval `grep "^Model=" ~/.kde4/share/config/kxkbrc`
|
||||||
|
[ "$Model" ] && \
|
||||||
|
XKB_MODEL="${Model/,*/}" || \
|
||||||
|
XKB_MODEL=`setxkbmap -print | grep xkb_geometry | sed "s|.*(\(.*\)).*|\1|"`
|
||||||
|
[ "$XKB_MODEL" ] || XKB_MODEL="pc105"
|
||||||
|
fi
|
||||||
awk '/! model/,/$^/' /usr/share/X11/xkb/rules/base.lst | sort -k2 | \
|
awk '/! model/,/$^/' /usr/share/X11/xkb/rules/base.lst | sort -k2 | \
|
||||||
while read id desc; do
|
while read id desc; do
|
||||||
if [ "$id" != "!" -a "$id" != "" ]; then
|
if [ "$id" != "!" -a "$id" != "" ]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user