File langset.sh of Package kiwi-config-openSUSE

#!/bin/sh

lang=en_US
for o in $(cat /proc/cmdline); do
    case $o in
       lang=*)
          eval $o
          ;;
    esac
done

# we need the _NOT so there is always a field 2
Country=$(echo "$lang"_NOT | cut -d_ -f2)
Language=$(echo "$lang" | cut -d_ -f1)

file="/etc/langset/$Language""_$Country"
if ! test -f "$file"; then
  file="/etc/langset/$Language"
fi

sed -e 's,: *,:,' "$file" | while read line; do
  key=`echo $line | cut -d: -f1`
  value=`echo $line | cut -d: -f2-`

  sed -i -e "s#$key=\".*#$key=\"$value\"#" /etc/sysconfig/language
  sed -i -e "s#$key=\".*#$key=\"$value\"#" /etc/sysconfig/keyboard
  sed -i -e "s#$key=\".*#$key=\"$value\"#" /etc/sysconfig/console
  sed -i -e "s#$key=\".*#$key=\"$value\"#" /etc/sysconfig/clock
done

echo "$Language""_$Country" > /var/lib/zypp/RequestedLocales
openSUSE Build Service is sponsored by