Home

Awesome

Lingva Translate

<img src="public/logo.svg" width="128" align="right">

Travis Build Vercel Status Cypress Tests License Awesome Humane Tech <img src="https://www.datocms-assets.com/31049/1618983297-powered-by-vercel.svg" alt="Powered by Vercel" height="20">

Alternative front-end for Google Translate, serving as a Free and Open Source translator with over a hundred languages available

How does it work?

Inspired by projects like NewPipe, Nitter, Invidious or Bibliogram, Lingva scrapes through Google Translate and retrieves the translation without directly accessing any Google-related service, preventing them from tracking.

For this purpose, Lingva is built, among others, with the following Open Source resources:

Deployment

As Lingva is a Next.js project you can deploy your own instance anywhere Next is supported.

The only requirement is to set an environment variable called NEXT_PUBLIC_SITE_DOMAIN with the domain you're deploying the instance under. This is used for the canonical URL and the meta tags.

Optionally, there are other environment variables available:

Docker

An official Docker image is available to ease the deployment using Compose, Kubernetes or similar technologies. Remember to also include the environment variables (simplified to site_domain, force_default_theme, default_source_lang and default_target_lang) when running the container.

Docker Compose:

version: '3'

services:

  lingva:
    container_name: lingva
    image: thedaviddelta/lingva-translate:latest
    restart: unless-stopped
    environment:
      - site_domain=lingva.ml
      - force_default_theme=light
      - default_source_lang=auto
      - default_target_lang=en
    ports:
      - 3000:3000

Docker Run

docker run -p 3000:3000 -e site_domain=lingva.ml -e force_default_theme=light -e default_source_lang=auto -e default_target_lang=en thedaviddelta/lingva-translate:latest

Vercel

Another easy way is to use the Next.js creators' own platform, Vercel, where you can deploy it for free with the following button.

Deploy with Vercel

Instances

These are the currently known Lingva instances. Feel free to make a Pull Request including yours (please remember to add [skip ci] to the last commit).

DomainHostingSSL Provider
lingva.ml (Official)VercelLet's Encrypt
translate.igna.wtfVercelLet's Encrypt
translate.plausibility.cloudHetznerLet's Encrypt
lingva.lunar.icuLansolCloudflare
translate.projectsegfau.ltSelf-hostedLet's Encrypt
translate.dr460nf1r3.orgNetcupCloudflare
lingva.garudalinux.orgHetznerCloudflare
translate.jae.fiSelf-hostedLet's Encrypt

Public APIs

Nearly all the Lingva instances should supply a pair of public developer APIs: a RESTful one and a GraphQL one.

Note: both APIs return the translation audio as a Uint8Array (served as number[] in JSON and [Int] in GraphQL) with the contents of the audio buffer.

REST API v1

{
    translation: string
    info?: TranslationInfo
}
{
    audio: number[]
}
{
    languages: [
        {
            code: string,
            name: string
        }
    ]
}

In addition, every endpoint can return an error message with the following structure instead.

{
    error: string
}

GraphQL API

query {
    translation(source: String target: String query: String!) {
        source: {
            lang: {
                code: String!
                name: String!
            }
            text: String!
            audio: [Int]!
            detected: {
                code: String
                name: String
            }
            typo: String
            pronunciation: String
            definitions: {
                type: String
                list: {
                    definition: String
                    example: String
                    field: String
                    synonyms: [String]
                }
            }
            examples: [String]
            similar: [String]
        }
        target: {
            lang: {
                code: String!
                name: String!
            }
            text: String!
            audio: [Int]!
            pronunciation: String
            extraTranslations: {
                type: String
                list: {
                    word: String
                    article: String
                    frequency: Int
                    meanings: [String]
                }
            }
        }
    }
    audio(lang: String! query: String!) {
        lang: {
            code: String!
            name: String!
        }
        text: String!
        audio: [Int]!
    }
    languages(type: SOURCE|TARGET) {
        code: String!
        name: String!
    }
}

Related projects

Contributors

Thanks goes to these wonderful people (emoji key):

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --> <!-- prettier-ignore-start --> <!-- markdownlint-disable --> <table> <tr> <td align="center"><a href="https://thedaviddelta.com/"><img src="https://avatars.githubusercontent.com/u/6679900?v=4?s=100" width="100px;" alt=""/><br /><sub><b>David</b></sub></a><br /><a href="#a11y-TheDavidDelta" title="Accessibility">️️️️♿️</a> <a href="https://github.com/TheDavidDelta/lingva-translate/commits?author=TheDavidDelta" title="Code">💻</a> <a href="https://github.com/TheDavidDelta/lingva-translate/commits?author=TheDavidDelta" title="Documentation">📖</a> <a href="#design-TheDavidDelta" title="Design">🎨</a> <a href="https://github.com/TheDavidDelta/lingva-translate/commits?author=TheDavidDelta" title="Tests">⚠️</a></td> <td align="center"><a href="https://github.com/mhmdanas"><img src="https://avatars.githubusercontent.com/u/32234660?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Mohammed Anas</b></sub></a><br /><a href="https://github.com/TheDavidDelta/lingva-translate/commits?author=mhmdanas" title="Code">💻</a></td> <td align="center"><a href="https://PussTheCat.org/"><img src="https://avatars.githubusercontent.com/u/47571719?v=4?s=100" width="100px;" alt=""/><br /><sub><b>TheFrenchGhosty</b></sub></a><br /><a href="https://github.com/TheDavidDelta/lingva-translate/commits?author=TheFrenchGhosty" title="Documentation">📖</a></td> </tr> </table> <!-- markdownlint-restore --> <!-- prettier-ignore-end --> <!-- ALL-CONTRIBUTORS-LIST:END -->

This project follows the all-contributors specification. Contributions of any kind welcome!

License

Copyright © 2021 thedaviddelta & contributors.
This project is GNU AGPLv3 licensed.