Updated translate-file.ps1

This commit is contained in:
Markus Fleschutz 2020-12-13 11:21:58 +00:00
parent 7709dc0ae1
commit 69c8c48203

View File

@ -11,15 +11,16 @@ if ($SourceFile -eq "" ) {
$SourceFile = read-host "Enter path to file"
}
if ($SourceLanguage -eq "" ) {
$SourceLanguage = read-host "Enter source language"
$SourceLanguage = read-host "Enter language of this file"
}
if ($TargetLanguage -eq "" ) {
$TargetLanguage = read-host "Enter target language"
$TargetLanguage = read-host "Enter language to translate to"
}
try {
$ScriptPath=$MyInvocation.MyCommand.Path
$ScriptPath/trans -i $SourceFile -s $SourceLanguage -t $TargetLanguage -e google -brief
$PathToScript=(get-item $MyInvocation.MyCommand.Path).directory
$PathToScript="$PathToScript/trans"
Start-Process -FilePath $PathToScript -ArgumentList "-i $SourceFile -s $SourceLanguage -t $TargetLanguage -e google -brief" -NoNewWindow -Wait
exit 0
} catch {
Write-Error "ERROR in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"