oferwald / transposh

Repository for Transposh git
GNU General Public License v3.0
13 stars 6 forks source link

Pages are not translated to any language automatically when google is preferred as translation engine. #1

Open jiturocks opened 2 years ago

jiturocks commented 2 years ago

Previously it is working fine with Google as preferred translation engine and after updating to version 1.0.9.1/1.0.9.2 it is not working, not any page is translating automatically. If I select Bing as preferred translation engine then it is working fine with Bing supported language.

oferwald commented 2 years ago

Hi @jiturocks, Google has the tendency to block access from time to time. This block is normally lifted after a few hours. You may look at the network tab in the browser console to get some useful debug information on why it is failing.

jiturocks commented 2 years ago

Hi @oferwald, I check the response by debugging curl request of transposh with google translation API it return 403 error code, and it is still returning the same. It is working with Google API till now. What do we need to make it work again?

Bouxesas commented 1 year ago

I have the same exact issue on versions 1.0.9.* Had to revert to 1.0.8.1 which works fine.

seobyte commented 1 year ago

I have the same exact issue on versions 1.0.9.* Had to revert to 1.0.8.1 which works fine.

Hi Bouxesas! I have a similar problem, and I would like to follow your footsteps. But where do I get the 1.0.8.1 version from?

Thank you!

Bouxesas commented 1 year ago

I have the same exact issue on versions 1.0.9.* Had to revert to 1.0.8.1 which works fine.

Hi Bouxesas! I have a similar problem, and I would like to follow your footsteps. But where do I get the 1.0.8.1 version from?

Thank you!

I usually save all the versions. I've attached it for you. transposh_1.0.8.1.zip

seobyte commented 1 year ago

I have the same exact issue on versions 1.0.9.* Had to revert to 1.0.8.1 which works fine.

Hi Bouxesas! I have a similar problem, and I would like to follow your footsteps. But where do I get the 1.0.8.1 version from? Thank you!

I usually save all the versions. I've attached it for you. transposh_1.0.8.1.zip

You are genius sir! Thank you very much!

jiturocks commented 1 year ago

I have the same exact issue on versions 1.0.9.* Had to revert to 1.0.8.1 which works fine.

Hey @Bouxesas I tried with 1.0.8.1 but it did not work. Are you using any API key for Google translation Engine ?

oferwald commented 1 year ago

Hello @jiturocks, There was no real change in the code of the google translation service from 1.0.8 to 1.0.9, I only added some logging, so you may see where it fails.

All previous versions of the plugin are available on transposh.org, just replacing the "latest" part of the download url with the version you want to download (example - https://svc.transposh.org/transposh.1.0.8.1.zip)

I strongly recommend against using older versions...

Bouxesas commented 1 year ago

Hello Ofer, After searching for a bit, I fount that my issue with Automatic translations on Admin frontend was the function on_ajax_tp_post_phrases() in transposh_admin.php

I had to change it as the older version to this:

function on_ajax_tp_post_phrases() {
    //$this->admins_only();   //version 1.0.9.3
    //$this->transposh->postpublish->get_post_phrases(filter_input(INPUT_POST, 'post', FILTER_VALIDATE_INT)); //version 1.0.9.3
    $this->transposh->postpublish->get_post_phrases($_GET['post']);
    die();
}

Also, for some reason, I had to change the "define('TRANSPOSH_PLUGIN_VER', '1.0.9.3');" to "define('TRANSPOSH_PLUGIN_VER', '1.0.8.1');" in file constants.php Cannot explain this.

After these two changes, automatic translation worked again.