From 32410b4254f1daf32258a29098db7493c411d150 Mon Sep 17 00:00:00 2001 From: Sam Pearman Date: Sun, 30 Aug 2020 22:47:59 +0900 Subject: [PATCH] Translation assistance scripts Translation assistance tool for quick and easy file generation/update/edit for future translators. --- .../translations/set-language.bat | 24 +++++++++++++++++++ .../translations/update-and-edit-language.bat | 12 ++++++++++ 2 files changed, 36 insertions(+) create mode 100644 src/duckstation-qt/translations/set-language.bat create mode 100644 src/duckstation-qt/translations/update-and-edit-language.bat diff --git a/src/duckstation-qt/translations/set-language.bat b/src/duckstation-qt/translations/set-language.bat new file mode 100644 index 000000000..b1a0c3694 --- /dev/null +++ b/src/duckstation-qt/translations/set-language.bat @@ -0,0 +1,24 @@ +@echo off +echo Set your language +echo. +echo Examples: +echo en ^<-- English +echo en-au ^<-- Australian English +echo ^<-- Remove language setting +echo. +echo For the 369-1 2-digit language code +echo https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes +echo. +echo If you require a country code as well (you probably don't) +echo https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes +echo. +echo.%lang% +set /p newlang="Enter language code: " +if defined newlang ( setx lang %newlang% ) +if defined lang if not defined newlang ( + echo Removing language setting... + setx lang "" 1>nul + reg delete HKCU\Environment /F /V lang 2>nul + reg delete "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /F /V lang 2>nul +) +pause diff --git a/src/duckstation-qt/translations/update-and-edit-language.bat b/src/duckstation-qt/translations/update-and-edit-language.bat new file mode 100644 index 000000000..7931b953a --- /dev/null +++ b/src/duckstation-qt/translations/update-and-edit-language.bat @@ -0,0 +1,12 @@ +@echo off + +if not defined lang (echo Please set your language first & pause & exit) + +set "linguist=..\..\..\dep\msvc\qt\5.15.0\msvc2017_64\bin" +set context=..\ + +"%linguist%\lupdate.exe" %context% -ts duckstation-qt_%lang%.ts +pause + +cd "%linguist%" +start /B linguist.exe "%~dp0\duckstation-qt_%lang%.ts"