2 rem Copyright (C) 2004-2008 the TortoiseSVN team
\r
3 rem This file is distributed under the same license as TortoiseSVN
\r
6 rem $Author: luebbe $
\r
7 rem $Date: 2008-09-29 19:22:31 +0800 (Mon, 29 Sep 2008) $
\r
10 rem Script to calculate the translation status of a single .po file
\r
12 rem %1=Working directory
\r
13 rem %2=Name of .po file
\r
14 rem %3=Number of strings in total
\r
16 SETLOCAL ENABLEDELAYEDEXPANSION
\r
18 set ScriptPath=%~dp0
\r
31 FOR /F "usebackq" %%p IN (`%ScriptPath%\Check_Errors.bat --check %2`) DO SET errSVN=%%p
\r
32 FOR /F "usebackq" %%p IN (`%ScriptPath%\Check_Errors.bat --check-accelerators %2`) DO SET accSVN=%%p
\r
33 FOR /F "usebackq" %%p IN (`%ScriptPath%\Check_Attrib.bat --translated --no-fuzzy --no-obsolete %2`) DO SET traSVN=%%p
\r
34 FOR /F "usebackq" %%p IN (`%ScriptPath%\Check_Attrib.bat --only-fuzzy --no-obsolete %2`) DO SET fuzSVN=%%p
\r
35 FOR /F "usebackq" %%p IN (`%ScriptPath%\Check_Attrib.bat --untranslated --no-obsolete %2`) DO SET untSVN=%%p
\r
37 SET /A errsumSVN=!fuzSVN!+!untSVN!+!errSVN!+!accSVN!
\r
42 ) else if !errsumSVN! EQU 0 (
\r
46 if !totSVN! EQU !traSVN! (
\r
48 set outStat=- ^(!fuzSVN!/!untSVN!/!accSVN!^)
\r
50 set /a outTMP=100*!traSVN!/totSVN
\r
52 if !outTMP! LSS 10 set outTMP= !outTMP!
\r
53 set outSVN=!outTMP!%%
\r
54 set outStat=- ^(!fuzSVN!/!untSVN!/!accSVN!^)
\r
64 set result=%outSVN% %outStat%%Blanks20:~1,20%
\r
65 set result=%result:~0,19%
\r