-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Description
Hello,
I'm trying to use the LibreTranslate API but without success. The return is always empty. I don't have a key because I use it occasionally and the API is free when you use it little.
What is the code missing to make it work?
Thank you for your reply
`
Try
Dim LibreTranslate = New LibreTranslate.Net.LibreTranslate
Dim SupportedLanguages As System.Collections.Generic.IEnumerable(Of SupportedLanguages) = Await LibreTranslate.GetSupportedLanguagesAsync()
'System.Console.WriteLine(Newtonsoft.Json.JsonConvert.SerializeObject(SupportedLanguages, Newtonsoft.Json.Formatting.Indented))
Dim frenchText = "Hello World!"
Dim spanishText As String = Await LibreTranslate.TranslateAsync(New Translate() With {
.Source = LanguageCode.English,
.Target = LanguageCode.Spanish,
.Text = frenchText
})
Debug.Print(spanishText)
Catch ex As Exception
Debug.Print(ex.Message)
End Try
`
Try
Dim LibreTranslate = New LibreTranslate.Net.LibreTranslate
Dim SupportedLanguages As System.Collections.Generic.IEnumerable(Of SupportedLanguages) = Await LibreTranslate.GetSupportedLanguagesAsync()
'System.Console.WriteLine(Newtonsoft.Json.JsonConvert.SerializeObject(SupportedLanguages, Newtonsoft.Json.Formatting.Indented))
Dim frenchText = "Hello World!"
Dim spanishText As String = Await LibreTranslate.TranslateAsync(New Translate() With {
.Source = LanguageCode.English,
.Target = LanguageCode.Spanish,
.Text = frenchText
})
Debug.Print(spanishText)
Catch ex As Exception
Debug.Print(ex.Message)
End Try
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels