title: Translate text using google without API
body: <p>I am trying to write a simple free translator (QT widget) using the online translation service.
  The idea is to send the standard get request to an online translator, and then parse the response.
  But the reply does not contain the translated text ! I guess this is because the service uses AJAX.
  In the example, I am using the google translator, but I get similar results with other translators (yandex, deepl).
  I know that there is a way to use the shareware API, but since the project is not commercial at the moment, I do not want to register a bank card.
  Is there a browser-like way to get translation without the API and use it for free ?</p>
  <p>I have searched for any information, but to my surprise, it was outdated and irrelevant at the moment (since Google closed the free service).</p>
  <p>And one more question. When I tried to cast the result to a QString  (QString s = reply-&gt;readAll().toString() or QString s = reply-&gt;readAll().toStdString().c_str()), I got a distorted htlm code (a lot of NUL characters at the beginning of the file). I assume that this is due to a misinterpretation of the escape sequences, but how then to cast the result correctly ? Even in the current version, there is some garbage at the beginning of the file (NUL NUL Уi).</p>
  <p>The code I use is:</p>
  <pre><code>void getTranslate() {
      QNetworkAccessManager manager;
      QUrl url(&quot;https://translate.google.com/#view=home&amp;op=translate&amp;sl=en&amp;tl=ru&amp;text=Hello%2C%20World%20!&quot;);
      QNetworkRequest request(url);
      QNetworkReply *reply = manager.get(request);
  
      do {
          QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
      } while(!reply-&gt;isFinished());
  
      QFile html(&quot;out.html&quot;);
      if (html.open(QIODevice::ReadWrite)) {
          QDataStream out(&amp;html);
          out &lt;&lt;  reply-&gt;readAll();
      }
  
      reply-&gt;close();
  
      delete reply;
  }
  </code></pre>