summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Pösel <robyer@seznam.cz>2013-06-19 13:53:01 +0000
committerRobert Pösel <robyer@seznam.cz>2013-06-19 13:53:01 +0000
commit5da13af4d0660c01e7aedb02083867a4484bedba (patch)
tree37b5b3df3f772d4654b792651573b4bca91d5f5a
parent618f12939c0ea66fb5502038400a1d44d9afb21a (diff)
More advanced version of Langpack Refresher. For your langpack usage look at langpacks/czech/Refresh.bat script.
git-svn-id: http://svn.miranda-ng.org/main/trunk@5038 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--langpacks/czech/Refresh.bat4
-rw-r--r--tools/lpgen/refresher.bat74
2 files changed, 62 insertions, 16 deletions
diff --git a/langpacks/czech/Refresh.bat b/langpacks/czech/Refresh.bat
new file mode 100644
index 0000000000..ceee3dce95
--- /dev/null
+++ b/langpacks/czech/Refresh.bat
@@ -0,0 +1,4 @@
+@echo off
+
+cd "..\..\tools\lpgen\"
+refresher.bat czech "Deprecated\old langpack\langpack_czech2.txt" \ No newline at end of file
diff --git a/tools/lpgen/refresher.bat b/tools/lpgen/refresher.bat
index 517e5ad503..93f54720b6 100644
--- a/tools/lpgen/refresher.bat
+++ b/tools/lpgen/refresher.bat
@@ -1,29 +1,71 @@
@echo off
-
-REM You can run this script either from "tools\lpgen\" folder or from "langpacks\<your_langpack>\"
+cls
echo ========================
-echo Langpack refresher
-echo Author: Robyer
+echo Langpack refresher
+echo Author: Robyer
echo ========================
+echo.
-echo Set your variables in script and remove this line. & PAUSE & goto end
+set err=0
+if "%~1" == "" (
+ echo ERROR: You must specify language parameter!
+ set err=1
+) else (
+ set "language=%~1"
+
+ if not exist "..\..\langpacks\%language%" (
+ echo ERROR: This language doesn't exists!
+ set err=1
+ goto usage
+ )
+)
-REM === VARIABLES TO SET ===
+if not "%~3" == "" (
+ echo ERROR: You must specify 1 or 2 parameters only.
+ echo NOTE: If you have path with spaces inside, suround it with "".
+ set err=1
+ goto usage
+)
-set "language=czech" & REM name of language from "langpacks\" folder
-set "useOldLangpack=yes" & REM "yes" or "no", if "yes" make sure you correctly set path to old langpack file below
-set "oldLangpackPath=Deprecated\old langpack\langpack_czech2.txt" & REM old langpack is searched in "langpacks\<your_langpack>\" folder
+if not "%~2" == "" (
+ set "oldLangpackPath=%~2"
+
+ if not exist "..\..\langpacks\%language%\%oldLangpackPath%" (
+ echo ERROR: Old langpack file doesn't exists!
+ set err=1
+ goto usage
+ )
+)
+
+:usage
+if "%err%"=="1" (
+ echo.
+ echo ========================
+ echo Usage: refresh.bat language ["old langpack path"]
+ echo Note: path to old langpack must be relative to "langpacks\<language>\" folder
+ echo.
+ echo Example 1: refresh.bat czech
+ echo Example 2: refresh.bat czech "Deprecated\old langpack\langpack_czech2.txt"
+ echo.
+ echo If you want own script in langpack dir, look at "langpacks\czech\refresh.bat"
+ echo ========================
+ echo.
+
+ pause
+ goto end
+)
REM =========================
-if "%useOldLangpack%" == "yes" (
+if defined "%oldLangpackPath%" (
set phase=0
) else (
set phase=1
)
:start
+echo Refreshing started...
cd "..\..\tools\lpgen\"
@@ -31,11 +73,11 @@ mkdir "Plugins"
mkdir "Untranslated"
if "%phase%" == "0" (
- REM load strings from old langpack
- cscript /nologo translate.js /log:"yes" /out:"Plugins" /untranslated:"Untranslated" /outfile:"langpack_%language%.txt" /path:"..\..\langpacks\%language%\Plugins" /core:"..\..\langpacks\%language%\=CORE=.txt" /langpack:"..\..\langpacks\%language%\%oldLangpackPath%"
+ echo Loading strings from old langpack...
+ cscript /nologo translate.js /out:"Plugins" /untranslated:"Untranslated" /outfile:"langpack_%language%.txt" /path:"..\..\langpacks\%language%\Plugins" /core:"..\..\langpacks\%language%\=CORE=.txt" /langpack:"..\..\langpacks\%language%\%oldLangpackPath%"
) else (
REM load strings from recently created langpack (also to distribute strings between files)
- cscript /nologo translate.js /log:"yes" /out:"Plugins" /untranslated:"Untranslated" /outfile:"langpack_%language%.txt" /path:"..\..\langpacks\%language%\Plugins" /core:"..\..\langpacks\%language%\=CORE=.txt" /langpack:"..\..\langpacks\%language%\Langpack_%language%.txt"
+ cscript /nologo translate.js /out:"Plugins" /untranslated:"Untranslated" /outfile:"langpack_%language%.txt" /path:"..\..\langpacks\%language%\Plugins" /core:"..\..\langpacks\%language%\=CORE=.txt" /langpack:"..\..\langpacks\%language%\Langpack_%language%.txt"
)
rm -r "../../langpacks/%language%/Plugins"
@@ -57,13 +99,13 @@ rm "Langpack_%language%.txt"
cd "..\..\langpacks\tool\"
LangpackSuite.exe \q \p%language%
-if "%phase%" == "1" (
- goto end
-) else (
+if not "%phase%" == "1" (
+ echo Loading strings from new langpack...
set "phase=1"
goto start
)
:end
+echo Refreshing finished!
REM ========================= \ No newline at end of file