Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return always empty #13

Open
Paragliderbe opened this issue Feb 1, 2024 · 0 comments
Open

Return always empty #13

Paragliderbe opened this issue Feb 1, 2024 · 0 comments

Comments

@Paragliderbe
Copy link

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant