From 0a4bc8a8e719e8bc771a2aad8b4a596453ca2ad6 Mon Sep 17 00:00:00 2001 From: teppyboy Date: Sun, 4 Oct 2020 21:40:59 +0700 Subject: [PATCH] Updated UpdateTranslations.ps1 Changes: + Added lrelease command. + Removed .bat file + Added a simple tutorial .txt (i'm not good at Markdown if i can't look at the code without color or preview) --- ScreenPlay/HowToUpdateTranslations.txt | 3 +++ ScreenPlay/UpdateTranslations.bat | 3 --- ScreenPlay/UpdateTranslations.ps1 | 27 ++++++++++++-------- ScreenPlay/translations/ScreenPlay_de.qm | Bin 15651 -> 15651 bytes ScreenPlay/translations/ScreenPlay_en.qm | Bin 747 -> 747 bytes ScreenPlay/translations/ScreenPlay_es.qm | Bin 15451 -> 15451 bytes ScreenPlay/translations/ScreenPlay_fr.qm | Bin 15962 -> 15962 bytes ScreenPlay/translations/ScreenPlay_ko.qm | Bin 11645 -> 11645 bytes ScreenPlay/translations/ScreenPlay_ru.qm | Bin 15747 -> 15747 bytes ScreenPlay/translations/ScreenPlay_vi.qm | Bin 24756 -> 24756 bytes ScreenPlay/translations/ScreenPlay_zh-CN.qm | Bin 0 -> 10299 bytes 11 files changed, 20 insertions(+), 13 deletions(-) create mode 100644 ScreenPlay/HowToUpdateTranslations.txt delete mode 100644 ScreenPlay/UpdateTranslations.bat create mode 100644 ScreenPlay/translations/ScreenPlay_zh-CN.qm diff --git a/ScreenPlay/HowToUpdateTranslations.txt b/ScreenPlay/HowToUpdateTranslations.txt new file mode 100644 index 00000000..dfd01f65 --- /dev/null +++ b/ScreenPlay/HowToUpdateTranslations.txt @@ -0,0 +1,3 @@ +Set your PowerShell execution policy using: Set-ExecutionPolicy Bypass (Run in Administrator) +To get your current Execution Policy use: Get-ExecutionPolicy +After that execute ./UpdateTranslations.ps1 in PowerShell and follow the tutorial. \ No newline at end of file diff --git a/ScreenPlay/UpdateTranslations.bat b/ScreenPlay/UpdateTranslations.bat deleted file mode 100644 index 62debe70..00000000 --- a/ScreenPlay/UpdateTranslations.bat +++ /dev/null @@ -1,3 +0,0 @@ -@echo off -powershell -executionpolicy bypass -File UpdateTranslations.ps1 -exit \ No newline at end of file diff --git a/ScreenPlay/UpdateTranslations.ps1 b/ScreenPlay/UpdateTranslations.ps1 index 07965a78..66dae761 100644 --- a/ScreenPlay/UpdateTranslations.ps1 +++ b/ScreenPlay/UpdateTranslations.ps1 @@ -2,24 +2,31 @@ echo "Updating translations..." $MSVCPATH = Read-Host 'Type your ABSOLUTE Qt "bin" directory (ex: F:\Qt\5.15.1\msvc2019_64\bin)' echo "Begin update translations..." $files = Get-ChildItem ".\translations" -foreach ($f in $files){ - echo "Processing $f" +Function Execute-Command ($commandTitle, $commandPath, $commandArguments, $commandWorkDir) +{ + $resolvedWorkDir = Resolve-Path -Path $commandWorkDir $pinfo = New-Object System.Diagnostics.ProcessStartInfo - $pinfo.FileName = "$MSVCPATH/lupdate.exe" + $pinfo.FileName = $commandPath $pinfo.RedirectStandardError = $true $pinfo.RedirectStandardOutput = $true $pinfo.UseShellExecute = $false - $pinfo.Arguments = "-extensions qml ..\qml -ts $f" - $pinfo.WorkingDirectory = ".\translations" + $pinfo.WorkingDirectory = $resolvedWorkDir + $pinfo.Arguments = $commandArguments $p = New-Object System.Diagnostics.Process $p.StartInfo = $pinfo $p.Start() | Out-Null $p.WaitForExit() - $stdout = $p.StandardOutput.ReadToEnd() - $stderr = $p.StandardError.ReadToEnd() - Write-Host "$stdout" - Write-Host "$stderr" - Write-Host "Exit code:" + $p.ExitCode + [pscustomobject]@{ + stdout = $p.StandardOutput.ReadToEnd() + stderr = $p.StandardError.ReadToEnd() + ExitCode = $p.ExitCode + } +} +foreach ($f in $files){ + echo "Processing $f (1/2)" + Execute-Command -commandTitle "Process translation file: $f" -commandPath "$MSVCPATH\lupdate.exe" -commandArguments "-extensions qml ..\qml -ts $f" -commandWorkDir "translations" + echo "Processing $f (2/2)" + Execute-Command -commandTitle "Process translation file: $f" -commandPath "$MSVCPATH\lrelease.exe" -commandArguments "$f" -commandWorkDir "translations" echo "Done" } echo "Updated translations." diff --git a/ScreenPlay/translations/ScreenPlay_de.qm b/ScreenPlay/translations/ScreenPlay_de.qm index 56436ccb53616c0a96283b4030948ca8368b7167..ef0d6a79c545a43f5486832d3dd5c9d3afba284d 100644 GIT binary patch delta 83 zcmZ2nwYX}-MIP1vK)}HO1Z*IJ9f*0Hi&7IyQay7E@{39snL!FRf8)8$$cL(Ql9={p PF8+x;EMNumrCSsM9TFeV delta 83 zcmZ2nwYX}-MIKcKAm9KIY#@RihZAlO{McZ3(hvXD_y0s!L}49W(ph++kj2i+Oj8MQ3Fxb~fG8hkHb0r-~7hm10+=q-{ z;gL9Bpmwn7csPWnc>&4jI+m~dM$$A}7V>J7CA0~FHR)rk2YJ#ZloeR<{&TK;CD{_- zedTqK{XfqCejLv`9vt=4^9T37GjZHMuYd9N&M)^Lju%6}6+jX=oyBjYTF z&&#GERQ4{iyd@ztt`ik>SrGchO{k#vHH7j`7^mfbjMK5+I49kL3Xc3IeE*Vh7Tksk z{)GS|A99qRL})@iTKdrYKz9~ex^EA#JY}5uj~S=+Q{((bADkx;D&LEifAax^+&!rK zdoRQ1v*`2!9`14HbEdYK;ExolbAvE!8%i)tC|G4RvQwM8+ z?!OnTc?$Ge^1FgPV}Akn>neEk#H%3x9}50?!j$vpLy24x0k?uKeUZ~j^fR*P5tm&V7DscbbM`_{$0>Z!ExIi zpMxH58f)u$;}XE-+YbNLT|jrQ?eHdgp0K^TcsfF8x9#&OQGJpj&5u<9I3H z9kc)Uit(VY&4n}n733KC+rs+rRfO!X7W(e2La1H_ zyR&`*e0|(Y&giU(2#w~PJDTAhR=;uLyPf;*_yNfIqVuVzMWFk<^GE>BNlTosH-o&T z+(mSud*Y?IdZ9c=A3en?}~ei>IFQfapwQj{pbg`fu1?{^T%HS{r#8w z?3Ezcd8GR*u?6h@LwA4dAvo_Yp7;iQE}B<7b(aqQ^GxyfM?qh%{^GsT0fZ`^EIzmn z_>Iwve?IX?2;q;5f3;y3=;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