mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-02-23 21:20:51 +01:00
Updated translate-text.ps1
This commit is contained in:
parent
a600b6dd18
commit
872cde2dbb
@ -10,7 +10,7 @@ param([string]$SourceText)
|
|||||||
if ($SourceText -eq "" ) {
|
if ($SourceText -eq "" ) {
|
||||||
$SourceText = "Hello World!"
|
$SourceText = "Hello World!"
|
||||||
}
|
}
|
||||||
$SourceLang = "en"
|
$SourceLanguage = "en"
|
||||||
$TargetLanguages = "af","da","de","el","es","hr","it","ja","ko","pl","pt","nl","ru","tr","uk","vi"
|
$TargetLanguages = "af","da","de","el","es","hr","it","ja","ko","pl","pt","nl","ru","tr","uk","vi"
|
||||||
|
|
||||||
function TranslateWithGoogle {
|
function TranslateWithGoogle {
|
||||||
@ -35,9 +35,9 @@ function TranslateWithGoogle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
foreach($TargetLang in $TargetLanguages) {
|
foreach($TargetLanguage in $TargetLanguages) {
|
||||||
$Result = TranslateWithGoogle $SourceText $SourceLang $TargetLang
|
$Result = TranslateWithGoogle $SourceText $SourceLanguage $TargetLanguage
|
||||||
write-output $TargetLang" : "$Result
|
write-output $TargetLanguage" : "$Result
|
||||||
}
|
}
|
||||||
exit 0
|
exit 0
|
||||||
} catch { Write-Error $Error[0] }
|
} catch { Write-Error $Error[0] }
|
||||||
|
Loading…
Reference in New Issue
Block a user