Index: nutchez-0.2/src/test/client_install_func.sh
===================================================================
--- nutchez-0.2/src/test/client_install_func.sh	(revision 188)
+++ nutchez-0.2/src/test/client_install_func.sh	(revision 189)
@@ -24,4 +24,12 @@
 function choose_lang(){
 
+lang=$(locale | grep 'LANG=' | cut -d "=" -f2)
+
+# Default: source english
+. lang_en_US_client_install
+# if locale is zh then source chinese
+echo $lang | grep 'zh' && source lang_zh_TW_nutchez
+
+# Ask language
 echo -e "\n$choose_lang_1"
 read -p "$choose_lang_2 " langChoice
@@ -77,10 +85,10 @@
 # 目前先檢查是否有/opt/nutchez 這個資料夾即可
 function check_nez_installed(){
-  debug_info "chcheck_nez_installed"
+  debug_info "$check_nez_1"
   if [ -d /opt/nutchez ]; then
-    show_info "System already had NutchEz."
-    exit
-  else
-    show_info "System does not has NutchEz."
+    show_info "$check_nez_2"
+    exit
+  else
+    show_info "$check_nez_3"
   fi
 }
@@ -91,6 +99,6 @@
 # (3)系統有安裝但Sun Java 在非預設路徑下 (4)以正確安裝 Sun JAVA 預設路徑下
 function check_sunJava(){
-  debug_info "check_sunJava"
-  debug_info "NutchEz need Sun Java JDK 1.6.x or above version"
+  debug_info "$check_sunJava_1"
+  debug_info "$check_sunJava_2"
 
   javaPath="/usr"
@@ -104,15 +112,15 @@
    
   if [ "$JAVA_org" == "" ]; then 
-    show_info "Java is not Sun version, plz install sun Java 1.6.X"
-    show_info "Please input your choice: "
-    show_info "(1)System don't have Sun Java (2)Sun Java is in other path (3)Exit"
-    read -p "plz input (1/2/3): " choice
+    show_info "$check_sunJava_if_1"
+    show_info "$check_sunJava_if_2"
+    show_info "$check_sunJava_if_3"
+    read -p "$check_sunJava_if_4" choice
     case $choice  in
       "1")
-        show_info "Please install Sun Java manually!"
+        show_info "$check_sunJava_if_5"
         exit 
         ;;
       "2")
-        read -p "Input Sun Java home path(ex. '/usr/lib/jvm/java-6-sun-1.6.0.12' or using default '/usr' ): " javaPath
+        read -p "$check_sunJava_if_6" javaPath
         ;;
         "*")
@@ -127,5 +135,5 @@
               
           if [ "$JAVA_org" == "" ]; then
-            show_info "It is not Sun Java! Plz install Sun Java manually!"
+            show_info "$check_sunJava_if_7"
             exit
             fi
@@ -135,11 +143,11 @@
       large16=$(echo "$JAVA_version >= 1.6" | bc)
       if [ "${large16}" == 0 ]; then
-        show_info "Java version is too old (it need 1.6.X above)"
+        show_info "$check_sunJava_if_8"
         exit
       fi  
       
-      show_info "System has Sun Java 1.6 above version."
-  else
-    show_info "Please install Sun JAVA 1.6.X or above version"
+      show_info "$check_sunJava_if_9"
+  else
+    show_info "$check_sunJava_if_10"
     exit
   fi
@@ -152,16 +160,16 @@
 # 檢查是否有安裝openssh, openssh-server
 function check_ssh(){
-  debug_info "check_ssh"
+  debug_info "$check_ssh_1"
   if [ -e /usr/bin/ssh ]; then
-    show_info "System has ssh."
-  else
-    show_info "Please install ssh."
+    show_info "$check_ssh_2"
+  else
+    show_info "$check_ssh_3"
     exit
   fi
 
   if [ -e /usr/sbin/sshd ]; then
-    show_info "System has ssh Server (sshd)."
-  else
-    show_info "Please install ssh Server (sshd)."
+    show_info "$check_ssh_4"
+  else
+    show_info "$check_ssh_5"
     exit
   fi
@@ -171,9 +179,9 @@
 # 檢查是否有安裝dialog
 function check_dialog(){
-  debug_info "check_dialog"
+  debug_info "$check_dialog_1"
   if [ -e /usr/bin/dialog ]; then
-    show_info "System has dialog."
-  else
-    show_info "Please install dialog."
+    show_info "$check_dialog_2"
+  else
+    show_info "$check_dialog_3"
     exit
   fi
@@ -185,24 +193,24 @@
 # 此步驟若無法連到 master 則跳出
 function scp_master_nutchuser_sshkey(){
-  debug_info "scp_master_nutchuser_sshkey"
-  debug_info "mkdir -p /home/nutchuser/"
+  debug_info "$scp_sshkey_d1"
+  debug_info "$scp_sshkey_d2"
   mkdir -p /home/nutchuser/.ssh/
   rm -fr /home/nutchuser/.ssh/*
   unset Nutchuser_Passwd2
 
-  debug_info "scp nutchuser@$1:~/.ssh /home/nutchuser/"
+  debug_info "$scp_sshkey_d3"
 expect -c "spawn scp -r -o StrictHostKeyChecking=no nutchuser@$1:~/.ssh /home/nutchuser/
 expect \"*: \" { send \"$Nutchuser_Passwd\r\" }
-expect \"*: \" { send_user \"Password is error\" }
+expect \"*: \" { send_user \"$scp_sshkey_expect_1\" }
 expect eof"
 
   if [ -e "/home/nutchuser/.ssh/authorized_keys" ]; then
-    show_info "scp correct."    
+    show_info "$scp_sshkey_s1"    
     else
-      show_info "scp error,\n(1)plese check nutchuser password in server\n(2)nutchuser's authorized_keys in server\n(3)server's network status"
+      show_info "$scp_sshkey_s2"
     exit
   fi
   ssh-add /home/nutchuser/.ssh/id_rsa
-  debug_info "chown -R nutchuser:nutchuser /home/nutchuser/.ssh"
+  debug_info "$scp_sshkey_d4"
   chown -R nutchuser:nutchuser /home/nutchuser/.ssh
 }
@@ -210,16 +218,16 @@
 # 新增nutchuser 帳號時用 Nutchuser_Passwd 當密碼
 function creat_nutchuser_account(){
-  debug_info "creat_nutchuser_account"
+  debug_info "$create_nutchuser_d1"
   while [ "$Nutchuser_Passwd" != "$Nutchuser_Passwd2" ]
   do
       echo -e "\n"
-      read -sp "Plz input nutchuser password of master node: " Nutchuser_Passwd
+      read -sp "$create_nutchuser_1" Nutchuser_Passwd
       echo 
-      read -sp "plz input nutchuser password, again: " Nutchuser_Passwd2
+      read -sp "$create_nutchuser_2" Nutchuser_Passwd2
       echo 
         if [ "$Nutchuser_Passwd" == "$Nutchuser_Passwd2" ]; then
-          show_info "Two Passwords match."
+          show_info "$create_nutchuser_3"
         else
-          show_info "Two passwords don't match, please re-input nutchuser's password."
+          show_info "$create_nutchuser_4"
         fi
   done                                                                                                                                    
@@ -227,5 +235,5 @@
 
   if [ $(cat /etc/passwd | grep nutchuser) ]; then
-    show_info "System already has nutchuser, change nutchuser password."
+    show_info "$create_nutchuser_s1"
     expect -c "spawn passwd nutchuser
     set timeout 1
@@ -236,5 +244,5 @@
     expect eof"
     else
-      show_info "Create nutchuser and change password."
+      show_info "$create_nutchuser_s2"
       useradd -m nutchuser -s /bin/bash
       expect -c "spawn passwd nutchuser
@@ -251,5 +259,5 @@
 # 目前僅需做到能無礙的複製遠端的/opt/nutchez/到local的/opt/
 function scp_packages(){
-  debug_info "scp_packages"
+  debug_info "$scp_packages_d1"
   mkdir /opt/nutchez
   mkdir /var/nutchez
@@ -258,10 +266,10 @@
   mkdir /home/nutchuser/nutchez/system
   chmod 777 /opt/nutchez
-  debug_info "chown -R nutchuser:nutchuser /opt/nutchez"
+  debug_info "$scp_packages_d2"
   chown -R nutchuser:nutchuser /opt/nutchez
   chown -R nutchuser:nutchuser /var/nutchez
   chown -R nutchuser:nutchuser /home/nutchuser/nutchez
   chmod 755 /opt/nutchez
-  debug_info "scp -r nutchuser@$1:/opt/nutchez/NutchezForClientOf_$Master_IP_Address.tar.gz /home/nutchuser/nutchez/source"
+  debug_info "$scp_packages_d3"
   su nutchuser -c "scp -r -o StrictHostKeyChecking=no nutchuser@$1:/home/nutchuser/nutchez/source/NutchezForClientOf_$Master_IP_Address.tar.gz /home/nutchuser/nutchez/source"
 
@@ -270,5 +278,5 @@
 
 function install_nutch_package(){
-  debug_info "install_nutch_package"
+  debug_info "$install_nutch_package_d1"
   tar -zxvf /home/nutchuser/nutchez/source/NutchezForClientOf_$Master_IP_Address.tar.gz -C /opt/nutchez
   sed -i '1a '$Master_IP_Address' '$Master_Hostname'' /etc/hosts
@@ -278,5 +286,5 @@
 
 function recall_hostname_ip(){
-  debug_info "recall_hostname_ip"
+  debug_info "$recall_hostname_ip_d1"
   net_interfaces=$(ifconfig | grep ^eth | cut -d " " -f1)
   net_nu=$(echo $net_interfaces | wc -w)
@@ -286,11 +294,11 @@
   net_address=$(ifconfig $net_interfaces | grep "inet addr:" | sed 's/^.*inet addr://g' | cut -d " " -f1)
   net_MacAddr=$(ifconfig $net_interfaces | grep 'HW' | sed 's/^.*HWaddr //g')
-  show_info "net_address is $net_address"
-  show_info "net_MacAddr is $net_MacAddr"
+  show_info "$recall_hostname_ip_1 $net_address"
+  show_info "$recall_hostname_ip_2 $net_MacAddr"
 
   # 若有多個 eth 時
     else
       declare -i i=1
-      show_info "System have multiple network device, which network use for this machine: "
+      show_info "$recall_hostname_ip_3"
        
       for net in $net_interfaces
@@ -300,5 +308,5 @@
       done
        
-      read -p "Please choice(1/2/3...): " net_choice
+      read -p "$recall_hostname_ip_4" net_choice
   if [ -z $net_choice ]; then
     net_choice=1
@@ -310,9 +318,9 @@
   net_address=$(ifconfig $net_interface | grep "inet addr:" | sed 's/^.*inet addr://g' | cut -d " " -f1)
   net_MacAddr=$(ifconfig $net_interface | grep 'HW' | sed 's/^.*HWaddr //g') 
-  show_info "net_address is $net_address"
-  show_info "net_MacAddr is $net_MacAddr"
-  fi
-
-  debug_info "ssh nutchuser@$1 echo $net_address $(hostname) $net_MacAddr \>\> ~/nutchez/system/nutch_nodes"
+  show_info "$recall_hostname_ip_1 $net_address"
+  show_info "$recall_hostname_ip_2 $net_MacAddr"
+  fi
+
+  debug_info "$recall_hostname_ip_d2"
   su nutchuser -c "ssh nutchuser@$1 echo $net_address $(hostname) $net_MacAddr \>\> ~/nutchez/system/nutch_nodes"
 
