Problem with WordPress and GTranslate (Error 504)

May I suggest looking at the below articles:

I am not sure how this plugin works, but if the user selects and click on the new language, does it mean that the plugin is actually sending the content for the translation from native to the needed language, and therefore if the server needs some more time to render the webpage throws an error, therefore you see error 504 Cloudflare?

Otherwise, it could be some hosting issue due to Web server or PHP.
I cannot confirm, but maybe it could if the timeout could be set to some higher value, but that I am afraid requires an Enterprise plan as far as Cloudflare will only wait 100 seconds for the request to complete.

  • … or that plugin actually needs more time - which takes longer than that?

Or, the temporary workaround could be if you could use and send it as an Ajax request from a hostname (sub-domain) which is not being proxied :orange:, rather being :grey: (DNS-only)?

Furthermore, a better approach from my point of a view would be to add Google Translate box to your website, so the user can select the defined possible language to translate from your native content just by selecting the needed from the dropdown, and on click, the user get shown the Google Translate bar at the top and the content being translated - no time need to wait and no errors.

Implementation that works on the above article URL:

Put this code below inside <body> ... </body> where you want the Google Translate box to appear.

<div id="google_translate_element"></div>

Put this code from below inside <head> ... </head> :

<script type="text/javascript">
function googleTranslateElementInit() {
    new google.translate.TranslateElement({
        pageLanguage: 'hr', // set default for your need
        includedLanguages: 'bg,bs,de,en,es,fr,hr,hu,it,ja,ko,mk,nl,ro,ru,sl,sq,sr,zh-CN', // include other languages per need
        layout: google.translate.TranslateElement.InlineLayout.SIMPLE, // style or type of the box
        gaTrack: true, // otherwise false if not using GA
        gaId: 'UA-XXXXXXX-X' // your Google Analytics tracking ID, not needed if not using GA
    }, 'google_translate_element');
<script type="text/javascript" src="//"></script>

Some usefull links:

I have the above implementation and it’s working on my articles so far for the last few years.

Example link of the implementation:

Works fine even on a mobile (responsive too):

From the screenshot above, the visitor just have to select the language from the dropdown (I haven’t added all the languages, rather the it’s based on the most visitors country) and wolla! Thing is working perfectly :wink:

That are the alternative languages which can be selected/choosen from the dropdown list.
It can be up to 64 languages as far as I know.

This Google Translate box with the code from above is working with an Cloudflare Rocket Loader being enabled too at my Website. No issues.

If your plugin works much more as an automatically method, I am afraid this is not possible without a paid plan. In that case, you would need Google Translate API and pay for the language per character or a word using the Google Cloud setup at your Website.

Otherwise, I would suggest looking into the Cloudflare Apps repository if anything similar already exists:

There are some more issues and topics abotu GTranslate here :search: