Advertisement
Guest User

Untitled

a guest
Mar 28th, 2017
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. #
  4. # Copyright (C) 2017 Nethesis S.r.l.
  5. #
  6. # This script is part of NethServer.
  7. #
  8. # NethServer is free software: you can redistribute it and/or modify
  9. # it under the terms of the GNU General Public License as published by
  10. # the Free Software Foundation, either version 3 of the License,
  11. # or any later version.
  12. #
  13. # NethServer is distributed in the hope that it will be useful,
  14. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. # GNU General Public License for more details.
  17. #
  18. # You should have received a copy of the GNU General Public License
  19. # along with NethServer. If not, see COPYING.
  20. #
  21.  
  22. if ! which tx >/dev/null; then
  23. echo "Transifex client not found. Install Transifex client." 2>&1
  24. exit 1
  25. fi
  26.  
  27. prefix=$(basename $(pwd))
  28. cfg=.tx/config
  29. propfiles=($(find -type f -name '*EN.properties'))
  30.  
  31. if ! [ -f "${cfg}" ]; then
  32. tx init
  33. fi
  34.  
  35. for src in ${propfiles[@]}; do
  36. parentdir=$(dirname $src)
  37. module=$(basename $parentdir)
  38. grep -F "${src}" ${cfg} && continue
  39. resource=$(basename -s .php ${src} | sed -e 's/_en_EN\.properties//g' -e 's/\./_/g')
  40. echo "[webtop5.${prefix}-${module}_${resource}]
  41. source_file = ${src}
  42. source_lang = en
  43. type = PROPERTIES
  44.  
  45. " >> ${cfg}
  46. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement