From 2c545d5269242335130a781211b4fd5fb50afdb0 Mon Sep 17 00:00:00 2001 From: Markus Fleschutz Date: Fri, 12 Feb 2021 12:26:40 +0100 Subject: [PATCH] Update translate-file.ps1 --- Scripts/translate-file.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Scripts/translate-file.ps1 b/Scripts/translate-file.ps1 index 190f2e68..f6476b46 100755 --- a/Scripts/translate-file.ps1 +++ b/Scripts/translate-file.ps1 @@ -6,13 +6,13 @@ .NOTES Author: Markus Fleschutz / License: CC0 #> -param($SourceFile = "", $SourceLanguage = "", $TargetLanguage = "") +param($File = "", $SourceLanguage = "", $TargetLanguage = "") try { $PathToRepo = "$PSScriptRoot/.." - if ($SourceFile -eq "" ) { - $SourceFile = read-host "Enter path to file" + if ($File -eq "" ) { + $File = read-host "Enter path to file" } if ($SourceLanguage -eq "" ) { $SourceLanguage = read-host "Enter language of this file" @@ -21,7 +21,7 @@ try { $TargetLanguage = read-host "Enter language to translate to" } - Start-Process -FilePath "$PathToRepo/Data/trans" -ArgumentList "-i $SourceFile -s $SourceLanguage -t $TargetLanguage -e google -brief" -NoNewWindow -Wait + Start-Process -FilePath "$PathToRepo/Data/trans" -ArgumentList "-i $File -s $SourceLanguage -t $TargetLanguage -e google -brief" -NoNewWindow -Wait exit 0 } catch { write-error "ERROR in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"