summaryrefslogtreecommitdiff
path: root/tools/xgettext.bat
blob: 18403dba6666bc95c085d9ec8aa4250d980a71cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
@echo off
setlocal

set me=%~n0

rem # Uncomment the following line if gettext is not in your PATH.
rem # Value must be absolute and end in a backslash.
rem set gtprefix=C:\path\to\gettext\bin\

if "%1" == "" (
	echo Usage: %me% FILE... 1>&2
	exit 1
)

set xgettext=%gtprefix%xgettext.exe
set msgmerge=%gtprefix%msgmerge.exe

md locale > nul 2>&1
echo Generating template... 1>&2
echo %xgettext% --from-code=UTF-8 -kS -kNS:1,2 -k_ -o locale/template.pot %*
%xgettext% --from-code=UTF-8 -kS -kNS:1,2 -k_ -o locale/template.pot %*
if %ERRORLEVEL% neq 0 goto done

cd locale

for %%f in (*.po) do (
	echo Updating %%f... 1>&2
	%msgmerge% --update %%f template.pot
)

echo DONE! 1>&2

:done