Commit 10067eb5b079e19ce55192214b2193edbf39c89e

Authored by Silvan Calarco
1 parent 460230742e
Exists in master

installer.kmdr: fixes for language and locale settings; drop support; drop suppo…

…rt for /etc/sysconfig/{i18n,keyboard}

Showing 1 changed file with 19 additions and 16 deletions Side-by-side Diff

installer/installer.kmdr
... ... @@ -953,8 +953,7 @@
953 953 *) LANGUAGE="${Language}" ;;
954 954 esac
955 955 LANGUAGE=${LANGUAGE:0:5}.UTF-8
956   - sed -i "s|LANG=.*|LANG=$LANGUAGE|" /etc/sysconfig/i18n
957   - sed -i "s|LANG=.*|LANG=$LANGUAGE|" /etc/locale.conf
  956 + sudo sed -i "s|LANG=.*|LANG=$LANGUAGE|" /etc/locale.conf
958 957 fi
959 958 fi
960 959 @execEnd
... ... @@ -977,8 +976,7 @@
977 976 </property>
978 977 <property name="associations" stdset="0">
979 978 <stringlist>
980   - <string>. /etc/sysconfig/i18n
981   -LANGUAGE="$LANG"
  979 + <string>LANGUAGE="$LANG"
982 980 if [ -r ~/.kde4/share/config/kdeglobals ]; then
983 981 eval `grep -i Country ~/.kde4/share/config/kdeglobals`
984 982 # find country definition in selected language
... ... @@ -1000,6 +998,7 @@
1000 998 case ${LANGUAGE:0:5} in
1001 999 en_*) LANGUAGE="English (${LANGUAGE:3:2})" ;;
1002 1000 es_*) LANGUAGE="Español" ;;
  1001 + fr_*) LANGUAGE="Français" ;;
1003 1002 it_IT) LANGUAGE="Italiano" ;;
1004 1003 it_CH) LANGUAGE="Italiano (CH)" ;;
1005 1004 *) LANGUAGE="${LANGUAGE:0:2}" ;;
1006 1005  
... ... @@ -1139,17 +1138,14 @@
1139 1138 <stringlist>
1140 1139 <string>LAYOUT_CURR="@kblayout_box.item(@kblayout_box.currentItem)"
1141 1140 MODEL_CURR="@kbgeometry_box.item(@kbgeometry_box.currentItem)"
1142   -LAYOUT=`awk '/! layout/,/$^/' /usr/share/X11/xkb/rules/base.lst | grep "$LAYOUT_CURR" | awk '{print $1}'`
1143   -MODEL=`awk '/! model/,/$^/' /usr/share/X11/xkb/rules/base.lst | grep "$MODEL_CURR" | awk '{print $1}'`
  1141 +LAYOUT=`awk '/! layout/,/$^/' /usr/share/X11/xkb/rules/base.lst | grep " $LAYOUT_CURR$" | awk '{print $1}'`
  1142 +MODEL=`awk '/! model/,/$^/' /usr/share/X11/xkb/rules/base.lst | grep " $MODEL_CURR$" | awk '{print $1}'`
1144 1143 setxkbmap -layout $LAYOUT -model $MODEL
1145   -sed -i "s|\(KEYMAP=\).*|\1$LAYOUT.map|" /etc/sysconfig/keyboard
1146   -sed -i "s|\(XKB_LAYOUT=\).*|\1$LAYOUT|" /etc/sysconfig/keyboard
1147   -sed -i "s|\(XKB_MODEL=\).*|\1$MODEL|" /etc/sysconfig/keyboard
1148   -sed -i "s|\(\"XkbLayout\"\).*|\1 \"$LAYOUT\"|" /etc/X11/xorg.conf
1149   -sed -i "s|\(\"XkbModel\"\).*|\1 \"$MODEL\"|" /etc/X11/xorg.conf
1150   -sed -i "s|\(\"XkbLayout\"\).*|\1 \"$LAYOUT\"|" /etc/X11/xorg.conf.d/10-keyboard.conf
1151   -sed -i "s|\(\"XkbModel\"\).*|\1 \"$MODEL\"|" /etc/X11/xorg.conf.d/10-keyboard.conf
1152   -sed -i "s|\(KEYMAP=\).*|\1$LAYOUT|" /etc/vconsole.conf
  1144 +sudo sed -i "s|\(\"XkbLayout\"\).*|\1 \"$LAYOUT\"|" /etc/X11/xorg.conf
  1145 +sudo sed -i "s|\(\"XkbModel\"\).*|\1 \"$MODEL\"|" /etc/X11/xorg.conf
  1146 +sudo sed -i "s|\(\"XkbLayout\"\).*|\1 \"$LAYOUT\"|" /etc/X11/xorg.conf.d/10-keyboard.conf
  1147 +sudo sed -i "s|\(\"XkbModel\"\).*|\1 \"$MODEL\"|" /etc/X11/xorg.conf.d/10-keyboard.conf
  1148 +sudo sed -i "s|\(KEYMAP=\).*|\1$LAYOUT|" /etc/vconsole.conf
1153 1149 </string>
1154 1150 </stringlist>
1155 1151 </property>
1156 1152  
... ... @@ -1170,12 +1166,12 @@
1170 1166 <stringlist>
1171 1167 <string>@testEdit.setSelection(@testEdit.text)
1172 1168 dcop @dcopid KommanderIf setBusyCursor true
1173   -. /etc/sysconfig/keyboard
1174 1169 if [ ! "$XKB_LAYOUT" ]; then
1175 1170 eval `grep "^LayoutList=" ~/.kde4/share/config/kxkbrc`
1176 1171 [ "$LayoutList" ] &amp;&amp; \
1177 1172 XKB_LAYOUT="${LayoutList/,*/}" || \
1178   - XKB_LAYOUT="us"
  1173 + XKB_LAYOUT=`setxkbmap -print | awk -F"+" '/xkb_symbols/ { print $2}'`
  1174 + [ "$XKB_LAYOUT" ] || XKB_LAYOUT="us"
1179 1175 fi
1180 1176 awk '/! layout/,/$^/' /usr/share/X11/xkb/rules/base.lst | sort -k2 | \
1181 1177 while read id desc; do
... ... @@ -1185,6 +1181,13 @@
1185 1181 fi
1186 1182 done
1187 1183  
  1184 +if [ ! "$XKB_MODEL" ]; then
  1185 + eval `grep "^Model=" ~/.kde4/share/config/kxkbrc`
  1186 + [ "$Model" ] &amp;&amp; \
  1187 + XKB_MODEL="${Model/,*/}" || \
  1188 + XKB_MODEL=`setxkbmap -print | grep xkb_geometry | sed "s|.*(\(.*\)).*|\1|"`
  1189 + [ "$XKB_MODEL" ] || XKB_MODEL="pc105"
  1190 +fi
1188 1191 awk '/! model/,/$^/' /usr/share/X11/xkb/rules/base.lst | sort -k2 | \
1189 1192 while read id desc; do
1190 1193 if [ "$id" != "!" -a "$id" != "" ]; then