From c8f322e9c73b8dcb33de52178100daebb0586aeb Mon Sep 17 00:00:00 2001 From: JustArchi Date: Wed, 9 May 2018 06:47:38 +0200 Subject: [PATCH] Update my crowdin scripts --- tools/crowdin-cli/README.md | 6 ++-- ...{archi_download.bat => archi_download.ps1} | 16 ++++++---- tools/crowdin-cli/archi_sync.bat | 26 ----------------- tools/crowdin-cli/archi_sync.ps1 | 29 +++++++++++++++++++ tools/crowdin-cli/archi_upload.bat | 12 -------- tools/crowdin-cli/archi_upload.ps1 | 15 ++++++++++ 6 files changed, 57 insertions(+), 47 deletions(-) rename tools/crowdin-cli/{archi_download.bat => archi_download.ps1} (53%) delete mode 100644 tools/crowdin-cli/archi_sync.bat create mode 100644 tools/crowdin-cli/archi_sync.ps1 delete mode 100644 tools/crowdin-cli/archi_upload.bat create mode 100644 tools/crowdin-cli/archi_upload.ps1 diff --git a/tools/crowdin-cli/README.md b/tools/crowdin-cli/README.md index f5f494d5c..1989ce22c 100644 --- a/tools/crowdin-cli/README.md +++ b/tools/crowdin-cli/README.md @@ -32,8 +32,8 @@ This tool is being used by ASF developers for synchronization of strings/transla ## Usage -- `archi_upload.bat` for pushing strings to Crowdin (when any `*Strings.resx` file gets modified). +- `archi_upload.ps1` for pushing strings to Crowdin. -- `archi_download.bat` for downloading translations from Crowdin (typically last commit before release). +- `archi_download.ps1` for downloading translations from Crowdin (typically last commit before release). -- `archi_sync.bat` for upload + download (tree sync, e.g. when modifying/removing original strings). +- `archi_sync.ps1` for upload + download (tree sync). diff --git a/tools/crowdin-cli/archi_download.bat b/tools/crowdin-cli/archi_download.ps1 similarity index 53% rename from tools/crowdin-cli/archi_download.bat rename to tools/crowdin-cli/archi_download.ps1 index 3ee944152..f3b2f68ff 100644 --- a/tools/crowdin-cli/archi_download.bat +++ b/tools/crowdin-cli/archi_download.ps1 @@ -1,14 +1,18 @@ -@echo off -pushd %~dp0 -cd ..\\.. -call crowdin -b master --identity tools\\crowdin-cli\\crowdin_identity.yml download +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' +$ProgressPreference = 'SilentlyContinue' + +Set-Location $PSScriptRoot +Set-Location ..\\.. + +crowdin -b master --identity tools\\crowdin-cli\\crowdin_identity.yml download git reset -cd wiki +Push-Location -Path wiki git pull git add -A "locale\*.md" git commit -m "Translations update" -cd .. +Pop-Location git add -A "ArchiSteamFarm\Localization\*.resx" "ArchiSteamFarm\www\locale\*.json" "WebConfigGenerator\src\locale\*.json" "wiki\locale\*.md" git commit -m "Translations update" diff --git a/tools/crowdin-cli/archi_sync.bat b/tools/crowdin-cli/archi_sync.bat deleted file mode 100644 index 2522d5bdc..000000000 --- a/tools/crowdin-cli/archi_sync.bat +++ /dev/null @@ -1,26 +0,0 @@ -@echo off -pushd %~dp0 -cd ..\\.. - -cd wiki -git reset --hard -git clean -fd -git pull -cd .. - -call crowdin -b master --identity tools\\crowdin-cli\\crowdin_identity.yml upload sources - -call crowdin -b master --identity tools\\crowdin-cli\\crowdin_identity.yml download -git reset - -cd wiki -git pull -git add -A "locale\*.md" -git commit -m "Translations update" -cd .. - -git add -A "ArchiSteamFarm\Localization\*.resx" "ArchiSteamFarm\www\locale\*.json" "WebConfigGenerator\src\locale\*.json" "wiki\locale\*.md" -git commit -m "Translations update" - -git push --recurse-submodules=on-demand -pause diff --git a/tools/crowdin-cli/archi_sync.ps1 b/tools/crowdin-cli/archi_sync.ps1 new file mode 100644 index 000000000..115cc239b --- /dev/null +++ b/tools/crowdin-cli/archi_sync.ps1 @@ -0,0 +1,29 @@ +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' +$ProgressPreference = 'SilentlyContinue' + +Set-Location $PSScriptRoot +Set-Location ..\\.. + +Push-Location -Path wiki +git reset --hard +git clean -fd +git pull +Pop-Location + +crowdin -b master --identity tools\\crowdin-cli\\crowdin_identity.yml upload sources + +crowdin -b master --identity tools\\crowdin-cli\\crowdin_identity.yml download +git reset + +Push-Location -Path wiki +git pull +git add -A "locale\*.md" +git commit -m "Translations update" +Pop-Location + +git add -A "ArchiSteamFarm\Localization\*.resx" "ArchiSteamFarm\www\locale\*.json" "WebConfigGenerator\src\locale\*.json" "wiki\locale\*.md" +git commit -m "Translations update" + +git push --recurse-submodules=on-demand +pause diff --git a/tools/crowdin-cli/archi_upload.bat b/tools/crowdin-cli/archi_upload.bat deleted file mode 100644 index f4133053e..000000000 --- a/tools/crowdin-cli/archi_upload.bat +++ /dev/null @@ -1,12 +0,0 @@ -@echo off -pushd %~dp0 -cd ..\\.. - -cd wiki -git reset --hard -git clean -fd -git pull -cd .. - -call crowdin -b master --identity tools\\crowdin-cli\\crowdin_identity.yml upload sources -pause diff --git a/tools/crowdin-cli/archi_upload.ps1 b/tools/crowdin-cli/archi_upload.ps1 new file mode 100644 index 000000000..dbd3da898 --- /dev/null +++ b/tools/crowdin-cli/archi_upload.ps1 @@ -0,0 +1,15 @@ +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' +$ProgressPreference = 'SilentlyContinue' + +Set-Location $PSScriptRoot +Set-Location ..\\.. + +Push-Location -Path wiki +git reset --hard +git clean -fd +git pull +Pop-Location + +crowdin -b master --identity tools\\crowdin-cli\\crowdin_identity.yml upload sources +pause