diff --git a/crowdin-sync.bat b/crowdin-sync.bat index f40ea96..ae05a1b 100644 --- a/crowdin-sync.bat +++ b/crowdin-sync.bat @@ -1,22 +1,20 @@ @echo off -if "%QT64PATH%"=="" set QT64PATH=c:\Qt\qt-5.6.2-x64-msvc2013\5.6\msvc2013_64\bin -SET PATH=%PATH%;%QT64PATH%;c:\Program Files\7-Zip -del /S /Q *.qm >nul 2>&1 -curl -s -k https://api.crowdin.com/api/project/x64dbg/export?key=%CROWDIN_API_KEY% -curl -s -k -o translations.zip https://api.crowdin.com/api/project/x64dbg/download/all.zip?key=%CROWDIN_API_KEY% + +echo Uploading English sources to Crowdin... +java -jar crowdin-cli.jar upload sources +if not %ERRORLEVEL%==0 exit /b + +echo Downloading translations from Crowdin... rmdir /S /Q translations >nul 2>&1 -7z x -otranslations translations.zip >nul 2>&1 +java -jar crowdin-cli.jar download +if not %ERRORLEVEL%==0 exit /b + +echo Checking translations... TranslationChecker.exe translations --folder --fix set CHECKER_ERRORLEVEL=%ERRORLEVEL% -cd translations -for /D %%a in (*) do (set fname=%%a) & call :rename -move *.qm ..\ >nul 2>&1 -cd .. + +echo Generating Qt translations... +for %%f in (translations\*.ts) do ( + lrelease -nounfinished %%f +) exit /b %CHECKER_ERRORLEVEL% - -goto :eof - -:rename -set trname=x64dbg_%fname:-=_%.ts -copy %fname%\x64dbg.ts %trname% >nul 2>&1 -lrelease -nounfinished %trname% diff --git a/crowdin.yml b/crowdin.yml index ca85f63..25494cb 100644 --- a/crowdin.yml +++ b/crowdin.yml @@ -27,7 +27,7 @@ files: [ # Where translations will be placed # e.g. "/resources/%two_letters_code%/%original_file_name%" # - "translation": "/translations/%locale_with_underscore%/%original_file_name%", + "translation": "/translations/x64dbg_%locale_with_underscore%.ts", # # Files or directories for ignore