From 29528ead8df6e2246845ee33435e428cced9f657 Mon Sep 17 00:00:00 2001 From: JustArchi Date: Fri, 16 Nov 2018 21:28:04 +0100 Subject: [PATCH] Add crowdin download script --- scripts/crowdin/download.ps1 | 39 ++++++++++++++++++++++++++++++++++++ tools/ArchiCrowdin | 2 +- 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 scripts/crowdin/download.ps1 diff --git a/scripts/crowdin/download.ps1 b/scripts/crowdin/download.ps1 new file mode 100644 index 000000000..86640b994 --- /dev/null +++ b/scripts/crowdin/download.ps1 @@ -0,0 +1,39 @@ +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' +$ProgressPreference = 'SilentlyContinue' + +$archiCrowdinPath = 'tools\ArchiCrowdin' +$archiCrowdinScriptPath = "$archiCrowdinPath\archi.ps1" + +$crowdinConfigFileName = 'crowdin.yml' +$crowdinIdentityFileName = 'crowdin_identity.yml' +$crowdinIdentityPath = "$archiCrowdinPath\$crowdinIdentityFileName" + +$archiTargets = @('ASF-ui', 'ASF-WebConfigGenerator', 'this') + +Push-Location "$PSScriptRoot" + +try { + for ($i = 0; ($i -lt 3) -and (!(Test-Path "$crowdinConfigFileName" -PathType Leaf)); $i++) { + Set-Location .. + } + + if (!(Test-Path "$crowdinConfigFileName" -PathType Leaf)) { + throw "$crowdinConfigFileName could not be found, aborting." + } + + if (!(Test-Path "$archiCrowdinScriptPath" -PathType Leaf)) { + throw "$archiCrowdinScriptPath could not be found, aborting." + } + + if (!(Test-Path "$crowdinIdentityPath" -PathType Leaf)) { + throw "$crowdinIdentityPath could not be found, aborting." + } + + $ErrorActionPreference = 'Continue' + & "$archiCrowdinScriptPath" -t:$archiTargets -d -c -p +} finally { + Pop-Location +} + +pause diff --git a/tools/ArchiCrowdin b/tools/ArchiCrowdin index 47a5365d0..eb92bf4f5 160000 --- a/tools/ArchiCrowdin +++ b/tools/ArchiCrowdin @@ -1 +1 @@ -Subproject commit 47a5365d055b7fd4d1deb1a20bf8918ce3b3c07d +Subproject commit eb92bf4f51893b59960a6f6eb0e755cd247250e1