mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-08-09 05:04:39 +02:00
Update the translate-*.ps1 scripts
This commit is contained in:
@ -21,7 +21,7 @@ param([string]$Text = "", [string]$SourceLangCode = "en", [string]$TargetLangCod
|
||||
|
||||
function UseLibreTranslate { param([string]$Text, [string]$SourceLangCode, [string]$TargetLangCode)
|
||||
$Parameters = @{"q"="$Text"; "source"="$SourceLangCode"; "target"="$TargetLangCode"; }
|
||||
$Result = (Invoke-WebRequest -Uri https://translate.mentality.rip/translate -Method POST -Body ($Parameters|ConvertTo-Json) -ContentType "application/json" -useBasicParsing).content | ConvertFrom-Json
|
||||
$Result = (Invoke-WebRequest -Uri https://libretranslate.de/translate -Method POST -Body ($Parameters|ConvertTo-Json) -ContentType "application/json" -useBasicParsing).content | ConvertFrom-Json
|
||||
return $Result.translatedText
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user