installer: also support /etc/locale.conf; fixed locale base support for non-KDE installations

This commit is contained in:
Silvan Calarco 2011-10-30 16:32:23 +01:00
parent 4df882a34e
commit 3e711cfee0
2 changed files with 16 additions and 6 deletions

View File

@ -938,19 +938,28 @@ dcop @dcopid KommanderIf setText timelabel "$currdate"
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
[ "${Country}" ] || Country="C"
COUNTRY=`eval grep -m1 "${Country}$" /opt/kde/share/apps/kabc/countrytransl.map | sed "s|\t.*||"`
else
case ${LANGUAGE:3:2} in
IT) COUNTRY="Italy" ;;
CH) COUNTRY="Switzerland" ;;
US) COUNTRY="United States" ;;
UK) COUNTRY="United Kingdom" ;;
ES) COUNTRY="Spain" ;;
FR) COUNTRY="France" ;;
*) COUNTRY="${LANGUAGE:3:5}" ;;
esac
fi fi
# find country definition in selected language
[ "${Country}" ] || Country="C"
COUNTRY=`eval grep -m1 "${Country}$" /opt/kde/share/apps/kabc/countrytransl.map | sed "s|\t.*||"`
# find language definition in selected language # find language definition in selected language
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" ;;
it_IT) LANGUAGE="Italiano" ;; it_IT) LANGUAGE="Italiano" ;;
it_CH) LANGUAGE="Italiano (CH)" ;; it_CH) LANGUAGE="Italiano (CH)" ;;
*) LANGUAGE="Unsupported" ;; *) LANGUAGE="${LANGUAGE:0:2}" ;;
esac esac
dcop @dcopid KommanderIf setText langlabel "$LANGUAGE" dcop @dcopid KommanderIf setText langlabel "$LANGUAGE"
dcop @dcopid KommanderIf setText countrylabel $"$COUNTRY" dcop @dcopid KommanderIf setText countrylabel $"$COUNTRY"
@ -991,6 +1000,7 @@ if [ -r ~/.kde4/share/config/kdeglobals ]; then
esac esac
LANGUAGE=${LANGUAGE:0:5}.UTF-8 LANGUAGE=${LANGUAGE:0:5}.UTF-8
sed -i "s|LANG=.*|LANG=$LANGUAGE|" /etc/sysconfig/i18n sed -i "s|LANG=.*|LANG=$LANGUAGE|" /etc/sysconfig/i18n
sed -i "s|LANG=.*|LANG=$LANGUAGE|" /etc/locale.conf
fi fi
fi fi
@execEnd @execEnd

View File

@ -344,7 +344,7 @@ dcop_write_details $"\
${MOUNT_SPACE} Mbytes copied ${MOUNT_SPACE} Mbytes copied
Installation time: $TIME_ELAPSED minutes" Installation time: $TIME_ELAPSED minutes"
CONFIGURED_FILES="/etc/sysconfig/keyboard /etc/sysconfig/i18n /etc/sysconfig/vconsole.conf \ CONFIGURED_FILES="/etc/sysconfig/keyboard /etc/sysconfig/i18n /etc/vconsole.conf /etc/locale.conf \
/etc/X11/xorg.conf /etc/X11/xorg.conf.d/10-keyboard.conf /etc/X11/xorg.conf.d/20-touchpad.conf" /etc/X11/xorg.conf /etc/X11/xorg.conf.d/10-keyboard.conf /etc/X11/xorg.conf.d/20-touchpad.conf"
for f in $CONFIGURED_FILES; do for f in $CONFIGURED_FILES; do
cp $f ${MOUNTPOINT}/${f} cp $f ${MOUNTPOINT}/${f}