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

Lingva API return error for texts contains URLs #161

Open
vitonsky opened this issue May 12, 2023 · 0 comments
Open

Lingva API return error for texts contains URLs #161

vitonsky opened this issue May 12, 2023 · 0 comments

Comments

@vitonsky
Copy link

Hi, i'm working on Linguist - browser addon to translate pages, i've implement custom translator for lingva project https://github.com/translate-tools/linguist-translators/blob/c826016314f5f3f68b69d83b9e3182618b991086/translators/LingvaTranslator.js

Users report this issue translate-tools/linguist#354

I've investigated it and as i see, Lingva return error while users trying to translate text of URLs.

Request example

await fetch("https://lingva.ml/api/v1/en/tr/https://github.com/translate-tools/linguist-translators/blob/c826016314f5f3f68b69d83b9e3182618b991086/translators/LingvaTranslator.js", {
    "credentials": "omit",
    "headers": {
        "Accept": "*/*",
        "Accept-Language": "en-US,en;q=0.5",
        "Sec-Fetch-Dest": "empty",
        "Sec-Fetch-Mode": "cors",
        "Sec-Fetch-Site": "same-origin"
    },
    "method": "GET",
    "mode": "cors"
}).then(r => r.json());

Actual response

{
  "error": "Not Found"
}

Expected response

Translated text or the same text as in request with no changes

Solution i suggest

Lingva could just return the same text with no changes for cases like this

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