home *** CD-ROM | disk | FTP | other *** search
/ Cricao de Sites - 650 Layouts Prontos / WebMasters.iso / Servidores / xampp-win32-1.6.7-installer.exe / phpMyAdmin / lang / add_message_file.sh next >
Encoding:
Linux/UNIX/POSIX Shell Script  |  2008-06-23  |  766 b   |  33 lines

  1. #!/bin/bash
  2. # $Id: add_message_file.sh 7364 2005-09-24 08:49:52Z nijel $
  3. #
  4. # Shell script that adds a message file to all message files
  5. # adding "//to translate" on each line
  6. #
  7. # Example:  add_message_file.sh  xxx
  8. #
  9. if [ $# -ne 1 ] ; then
  10.     echo "usage: add_message_file.sh filename"
  11.     exit 1
  12. fi
  13.  
  14. for file in *.inc.php
  15. do
  16.     echo $file " "
  17.     grep -v '?>' ${file} > ${file}.new
  18.     case $file in
  19.         english*)
  20.             sed -n 's/\(.*\);/\1;/p' $1 >> ${file}.new
  21.             ;;
  22.         *)
  23.             sed -n 's/\(.*\);/\1;  \/\/to translate/p' $1 >> ${file}.new
  24.             ;;
  25.     esac
  26.     echo "?>" >> ${file}.new
  27.     rm $file
  28.     mv ${file}.new $file
  29. done
  30. ./sort_lang.sh english*
  31. echo " "
  32. echo "Messages added to add message files (including english)"
  33.