mirror of
https://github.com/minetest-mods/intllib.git
synced 2025-07-03 16:40:23 +02:00
Add support for gettext message catalogs.
This commit is contained in:
33
tools/xgettext.bat
Normal file
33
tools/xgettext.bat
Normal file
@ -0,0 +1,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
|
Reference in New Issue
Block a user