浏览代码

Setting language

Bob Mottram 9 年前
父节点
当前提交
e7b6f13e9b
共有 2 个文件被更改,包括 21 次插入0 次删除
  1. 20
    0
      src/freedombone
  2. 1
    0
      src/freedombone-image-customise

+ 20
- 0
src/freedombone 查看文件

35
 export TEXTDOMAIN=$PROJECT_NAME
35
 export TEXTDOMAIN=$PROJECT_NAME
36
 export TEXTDOMAINDIR="/usr/share/locale"
36
 export TEXTDOMAINDIR="/usr/share/locale"
37
 
37
 
38
+DEFAULT_LANGUAGE='en_GB'
39
+
38
 # username created by default within a debian image
40
 # username created by default within a debian image
39
 GENERIC_IMAGE_USERNAME='fbone'
41
 GENERIC_IMAGE_USERNAME='fbone'
40
 
42
 
522
   exit 0
524
   exit 0
523
 }
525
 }
524
 
526
 
527
+function locale_setup {
528
+  if grep -Fxq "locale_setup" $COMPLETION_FILE; then
529
+      return
530
+  fi
531
+
532
+  apt-get -y install locales debconf
533
+  update-locale LANGUAGE=${DEFAULT_LANGUAGE}.UTF-8
534
+  update-locale LC_MESSAGES=${DEFAULT_LANGUAGE}.UTF-8
535
+  update-locale LC_ALL=${DEFAULT_LANGUAGE}.UTF-8
536
+  update-locale LC_CTYPE=${DEFAULT_LANGUAGE}.UTF-8
537
+
538
+  echo 'locale_setup' >> $COMPLETION_FILE
539
+}
525
 
540
 
526
 function interactive_configuration_remote_backups {
541
 function interactive_configuration_remote_backups {
527
   if [[ $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
542
   if [[ $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
857
       if [[ $CONFIGURATION_FILE != '/root/freedombone.cfg' ]]; then
872
       if [[ $CONFIGURATION_FILE != '/root/freedombone.cfg' ]]; then
858
           cp $CONFIGURATION_FILE /root/freedombone.cfg
873
           cp $CONFIGURATION_FILE /root/freedombone.cfg
859
       fi
874
       fi
875
+      if grep -q "DEFAULT_LANGUAGE" $CONFIGURATION_FILE; then
876
+          DEFAULT_LANGUAGE=$(grep "DEFAULT_LANGUAGE" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
877
+      fi
860
       if grep -q "MINIMAL_INSTALL" $CONFIGURATION_FILE; then
878
       if grep -q "MINIMAL_INSTALL" $CONFIGURATION_FILE; then
861
           MINIMAL_INSTALL=$(grep "MINIMAL_INSTALL" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
879
           MINIMAL_INSTALL=$(grep "MINIMAL_INSTALL" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
862
       fi
880
       fi
6157
   if grep -Fxq "initial_setup" $COMPLETION_FILE; then
6175
   if grep -Fxq "initial_setup" $COMPLETION_FILE; then
6158
       return
6176
       return
6159
   fi
6177
   fi
6178
+
6160
   apt-get -y remove --purge apache*
6179
   apt-get -y remove --purge apache*
6161
   apt-get -y dist-upgrade
6180
   apt-get -y dist-upgrade
6162
   apt-get -y install ca-certificates emacs24 cpulimit
6181
   apt-get -y install ca-certificates emacs24 cpulimit
11932
 
11951
 
11933
 
11952
 
11934
 read_configuration
11953
 read_configuration
11954
+locale_setup
11935
 parse_args
11955
 parse_args
11936
 check_domains
11956
 check_domains
11937
 install_not_on_BBB
11957
 install_not_on_BBB

+ 1
- 0
src/freedombone-image-customise 查看文件

355
 chroot "$rootdir" apt-get install -y avahi-daemon avahi-utils avahi-discover avahi-autoipd
355
 chroot "$rootdir" apt-get install -y avahi-daemon avahi-utils avahi-discover avahi-autoipd
356
 chroot "$rootdir" apt-get install -y iptables dnsutils net-tools network-manager iputils-ping
356
 chroot "$rootdir" apt-get install -y iptables dnsutils net-tools network-manager iputils-ping
357
 chroot "$rootdir" apt-get install -y libnss-mdns libnss-myhostname libnss-gw-name nano man ntp
357
 chroot "$rootdir" apt-get install -y libnss-mdns libnss-myhostname libnss-gw-name nano man ntp
358
+chroot "$rootdir" apt-get install -y locales debconf
358
 
359
 
359
 sed -i "s|#host-name=.*|host-name=${PROJECT_NAME}|g" $rootdir/etc/avahi/avahi-daemon.conf
360
 sed -i "s|#host-name=.*|host-name=${PROJECT_NAME}|g" $rootdir/etc/avahi/avahi-daemon.conf
360
 
361