summaryrefslogtreecommitdiff
path: root/tools/localize.bat
blob: 833f18702c6c8aba2bbd567dcaae518db12da723 (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
34
35
36
37
38
39
40
41
42
43
44
45
46
@echo off
REM
REM Usage: localize.bat
REM
REM This script should be executed after adding new resource strings and after
REM updating the translated .po files.
REM
REM This script
REM - builds the tools if required
REM - converts all compiled .rst files to .po files
REM - updates all translated xx.po files
REM

rem Make sure this is set correctly for your system
set FPCTARGET=i386-win32


if exist updatepofiles.exe goto SkipTools
echo The updatepofiles tool was not found, compiling tools...
echo.
rem build_tools.bat
fpc -O2 -Xs -XX -Sh -FUunits -oupdatepofiles.exe updatepofiles.pas
fpc -O2 -Xs -XX -Sh -FUunits -ogenerateincfiles.exe generateincfiles.pas

if not exist updatepofiles.exe goto Exit_Error

:SkipTools

echo Updating language files...
@set Constants_RST=..\lib\%FPCTARGET%\fpg_constants.rst
rstconv -i %Constants_RST% -o ..\languages\fpgui.po

updatepofiles.exe ..\languages\fpgui.po


REM generate new include files from the updated .po file.
generateincfiles.exe ..

goto Exit


:Exit_Error
echo Unable to compile the updatepofiles tool

:Exit