mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-08-10 05:17:44 +02:00
Cleanup
This commit is contained in:
@ -7,22 +7,22 @@
|
||||
# License: CC0
|
||||
|
||||
param([string]$SourceFile, [string]$SourceLanguage, [string]$TargetLanguage)
|
||||
if ($SourceFile -eq "" ) {
|
||||
$SourceFile = read-host "Enter path to file"
|
||||
}
|
||||
if ($SourceLanguage -eq "" ) {
|
||||
$SourceLanguage = read-host "Enter language of this file"
|
||||
}
|
||||
if ($TargetLanguage -eq "" ) {
|
||||
$TargetLanguage = read-host "Enter language to translate to"
|
||||
}
|
||||
|
||||
try {
|
||||
$PathToData=(get-item $MyInvocation.MyCommand.Path).directory
|
||||
$PathToData="$PathToData/../Data"
|
||||
Start-Process -FilePath "$PathToData/trans" -ArgumentList "-i $SourceFile -s $SourceLanguage -t $TargetLanguage -e google -brief" -NoNewWindow -Wait
|
||||
if ($SourceFile -eq "" ) {
|
||||
$SourceFile = read-host "Enter path to file"
|
||||
}
|
||||
if ($SourceLanguage -eq "" ) {
|
||||
$SourceLanguage = read-host "Enter language of this file"
|
||||
}
|
||||
if ($TargetLanguage -eq "" ) {
|
||||
$TargetLanguage = read-host "Enter language to translate to"
|
||||
}
|
||||
|
||||
$PathToRepo=(get-item $MyInvocation.MyCommand.Path).directory.parent
|
||||
|
||||
Start-Process -FilePath "$PathToRepo/Data/trans" -ArgumentList "-i $SourceFile -s $SourceLanguage -t $TargetLanguage -e google -brief" -NoNewWindow -Wait
|
||||
exit 0
|
||||
} catch {
|
||||
Write-Error "ERROR in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
write-error "ERROR in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
|
Reference in New Issue
Block a user