mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-11-26 18:03:35 +01:00
Update translate-file.ps1
This commit is contained in:
parent
75924194bc
commit
2c545d5269
@ -6,13 +6,13 @@
|
|||||||
.NOTES Author: Markus Fleschutz / License: CC0
|
.NOTES Author: Markus Fleschutz / License: CC0
|
||||||
#>
|
#>
|
||||||
|
|
||||||
param($SourceFile = "", $SourceLanguage = "", $TargetLanguage = "")
|
param($File = "", $SourceLanguage = "", $TargetLanguage = "")
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$PathToRepo = "$PSScriptRoot/.."
|
$PathToRepo = "$PSScriptRoot/.."
|
||||||
|
|
||||||
if ($SourceFile -eq "" ) {
|
if ($File -eq "" ) {
|
||||||
$SourceFile = read-host "Enter path to file"
|
$File = read-host "Enter path to file"
|
||||||
}
|
}
|
||||||
if ($SourceLanguage -eq "" ) {
|
if ($SourceLanguage -eq "" ) {
|
||||||
$SourceLanguage = read-host "Enter language of this file"
|
$SourceLanguage = read-host "Enter language of this file"
|
||||||
@ -21,7 +21,7 @@ try {
|
|||||||
$TargetLanguage = read-host "Enter language to translate to"
|
$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
|
exit 0
|
||||||
} catch {
|
} catch {
|
||||||
write-error "ERROR in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
write-error "ERROR in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||||
|
Loading…
Reference in New Issue
Block a user