xgettext.bat 720 B

12345678910111213141516171819202122232425262728293031323334
  1. @echo off
  2. setlocal
  3. set me=%~n0
  4. rem # Uncomment the following line if gettext is not in your PATH.
  5. rem # Value must be absolute and end in a backslash.
  6. rem set gtprefix=C:\path\to\gettext\bin\
  7. if "%1" == "" (
  8. echo Usage: %me% FILE... 1>&2
  9. exit 1
  10. )
  11. set xgettext=%gtprefix%xgettext.exe
  12. set msgmerge=%gtprefix%msgmerge.exe
  13. md locale > nul 2>&1
  14. echo Generating template... 1>&2
  15. echo %xgettext% --from-code=UTF-8 -kS -kNS:1,2 -k_ -o locale/template.pot %*
  16. %xgettext% --from-code=UTF-8 -kS -kNS:1,2 -k_ -o locale/template.pot %*
  17. if %ERRORLEVEL% neq 0 goto done
  18. cd locale
  19. for %%f in (*.po) do (
  20. echo Updating %%f... 1>&2
  21. %msgmerge% --update %%f template.pot
  22. )
  23. echo DONE! 1>&2
  24. :done