3
REM This is a batch script to rebuild /locale directory (used to prepare Win32 release)
4
REM NOTE: requires some recent Windows (NT based)
7
IF NOT "%OS%"=="Windows_NT" GOTO :End
9
REM define some constants
14
SET msgfmt="C:\\Program Files\PoEdit\bin\msgfmt.exe"
15
SET tmpmo="C:\\Program Files\PoEdit\bin\messages.mo"
16
SET tmpdir="C:\\Program Files\PoEdit\bin\"
18
REM Check if source directory exists
20
IF NOT EXIST .\%srcdir%\NUL GOTO :End
22
REM Remove and recreate target directory
25
IF EXIST .\%target%\NUL RMDIR /S /Q %target%
31
FOR /R "%srcdir%" %%A IN (*.po) DO CALL :ProcessFile %%A
35
REM %%~n1 expands variable %%1 to file name only
36
REM %%~f1 expands variable %%1 to full path name
40
REM delete previously existing compiled message catalog (not to use junk one in case creating new one fails)
46
REM compile message catalog
47
%msgfmt% %~f1 -o %tmpmo% 2> nul
51
MKDIR %target%\%~n1\LC_MESSAGES 3> nul
52
copy %tmpmo% %target%\%~n1\LC_MESSAGES\%program%.mo > nul
55
echo Error: failed to compile %~n1 package!
b'\\ No newline at end of file'