126

ViktorVoronin Translation can not be free unless it is built in into the OS so we would need to wait for this.

Can you please share the source about such limitation?

  • Vlad replied to this.

    How do the free translation extensions work then?

    • Vlad replied to this.

      ViktorVoronin You would have to check with those extensions. Maybe same as 'free' browsers and 'free' search engines? I am not sure.

        I did a brief research into how the translation extensions work.

        Google (and likely others) has open translation endpoints that don't require a captcha or API token but have basic content and rate limiting in order to make their own translation extensions to work. The translation extensions I was referring to work by just mimicking the HTTP requests to the endpoints.

        De facto, there are free translation APIs but I'm not sure it's legal to use in a commercial project (is Orion one?) and there are no guarantees for the API stability.

        Could it be an opt-in experimental feature for people who can tolerate content/rate limiting and/or failures?

        • Vlad replied to this.

          ViktorVoronin

          Thank you for doing this work.

          1. We could hit the rate limit quickly (in the future)
          2. We would be sending user's private information to Google

            Vlad

            We could hit the rate limit quickly (in the future)

            No. It's up for a user to hit it or not. Assuming we're talking the client side implementation.

            We would be sending user's private information to Google

            It doesn't make difference for the use case I have in mind. If Orion translate a webpage or I go to https://translate.google.com and paste a URL to translate, Google gets the same information from me if not more.

            If it's an opt-in functionality when a user picks a provider and there is a warning that this feature shares IP and the translating text with the provider and it has to be triggered by the user (not automatically), I find it a great deal.

            😇

            • Vlad replied to this.

              ViktorVoronin Google Translation API requires a token that you use in your application. All usage beyond the free tier would be charged to the owner of the token, which would be us.

              https://cloud.google.com/translate/

              What does make sense is to simply use a translation extension. We will be happy to include a native translation feature, once it is available in macOS.

                Vlad I'm not sure if you don't read my posts or I'm a terrible communicator. 😬

                There are endpoints that don't require an API token. Here is a demo for you:

                const googleTranslate = (text, langTo, langFrom = "auto") => {
                  return fetch(
                      `https://translate.googleapis.com/translate_a/single?` +
                      `client=gtx&dt=t&sl=${langFrom}&tl=${langTo}&q=${encodeURIComponent(text)}`
                    )
                    .then(res => res.json())
                    .then(data => data[0][0][0])
                }
                
                const input = window.prompt("Enter text to translate to Russian:")
                
                googleTranslate(input, langTo = "ru").then(translated =>
                  alert(`"${input}"\nin Russian would be:\n"${translated}".`)
                )
                • Vlad replied to this.
                  6 days later

                  ViktorVoronin Hm.. can you point out this API in the Google translate official API doc? We wouldn't want to implement an official API theat can be shut down ant any moment.

                    21 days later

                    optuma Thanks for this. I tried Vivaldi translation and it is not native nor private. You can easily test this by disabling your wifi and trying to translate a page - it will not work. It requires to send data to Vivaldi servers for translation (where is then processed by hosted Lingvanex software). So when Vivaldi says that it is "private by design", take it with a grain of salt.

                    We will include translation when one is available on macOS (so that it is truly native and private). Until then translation can be achieved using one of the many web extensions.

                    10 days later

                    Safari has a built in translation of webpages feature. It works well but it can not remember you were there and will not translate automatically. I would like to see Orion browser have one and be better than Safari. Otherwise your browser is awesome.

                    Thanks,

                    CucumberJam

                    It seems that Monterey added a native translation feature, we can definitely use that.

                    Merged 17 posts from Native web page translation.
                      10 days later
                      7 months later

                      In the meantime does anyone have a suggestion for a translation extension that actually works for translating full webpages?

                        Google translate should work

                          a month later

                          +1 for translation. Looking forward to this feature. Would probably be more useful on mobile for me, though.