txpull.sh 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #!/bin/sh
  2. #------------------------------------------------------
  3. # Script to pull language files to Transifex
  4. #
  5. # Laurent Destailleur - eldy@users.sourceforge.net
  6. #------------------------------------------------------
  7. # Usage: txpull.sh (all|xx_XX) [-r dolibarr.file] [-f]
  8. #------------------------------------------------------
  9. # Syntax
  10. if [ "x$1" = "x" ]
  11. then
  12. echo "This pull remote transifex files to local dir."
  13. echo "Note: If you pull a language file (not source), file will be skipped if local file is newer."
  14. echo " Using -f will overwrite local file (does not work with 'all')."
  15. echo "Usage: ./dev/translation/txpull.sh (all|xx_XX) [-r dolibarr.file] [-f] [-s]"
  16. exit
  17. fi
  18. if [ ! -d ".tx" ]
  19. then
  20. echo "Script must be ran from root directory of project with command ./dev/translation/txpull.sh"
  21. exit
  22. fi
  23. if [ "x$1" = "xall" ]
  24. then
  25. for dir in `find htdocs/langs/* -type d`
  26. do
  27. fic=`basename $dir`
  28. if [ $fic != "en_US" ]
  29. then
  30. echo "tx pull -l $fic $2 $3"
  31. tx pull -l $fic $2 $3
  32. fi
  33. done
  34. cd -
  35. else
  36. echo "tx pull -l $1 $2 $3 $4 $5"
  37. tx pull -l $1 $2 $3 $4 $5
  38. fi
  39. echo Think to launch also:
  40. echo "> dev/fixaltlanguages.sh fix all"