Andrei
Forum Replies Created
-
Hey there,
Thank you for reaching out to us!
We will be doing our best to replicate this behavior and get this sorted out as soon as possible.
Would you mind reaching to sg-cachepress and let us know if they encountered any other similar problems with TranslatePress?
Thank you for your patience so far!
Hey there,
We are sorry for not getting back to you any sooner on this matter!
I am glad you managed to work this out.
Do not hesitate to open another topic if you have further questions
Best Regards
Hello there,
Thanks for reaching out to us!
Please try clearing your cache before we further look into this. You can also try looking at this from an incognito tab to make sure.
Best Regards,
Greetings,
I have forwarded your message to one of our developers.
Why are these backend contents being translated in the first place?
TranslatePress already intentionally avoids translating back-end strings. In WordPress, admin-ajax.php requests can be used for both front-end (ex. bringing some text up for the site visitor during a JavaScript call to back-end) and from back-end (ex. plugin settings, dashboard). The first one needs translation, second one doesn’t. TranslatePress distinguishes between them by checking if the request referer was from the backend (so a link containing ‘/wp-admin’) or not.You are right, the text you saw translated is unnecessarily translated. It looks like a gettext string (localized plugin string) that never gets shown in front-end.
What could have happened in the case you described is that the referer of the request https://exemple.com/wp-admin/admin-ajax.php?action=next_recurrence&nonce=b6ce76e0c5&id=11964 was not a /wp-admin link.Is there a way to restrict the translation activities strictly to the frontend UI only?
You can try to enforce this using custom code that avoids translation when doing requests with specific GET/POST parameters if you are certain that these requests came from back-end and don’t need any translation./**Stop translating when doing certain admin-ajax calls
*
*/
add_action( ‘trp_before_running_hooks’, ‘trpc_disable_translation_when_requesting_action_next_recurrence’, 10, 1 );
function trpc_disable_translation_when_requesting_action_next_recurrence( $trp_loader ) { if ( isset( $_REQUEST[‘action’] ) && $_REQUEST[‘action’] === ‘next_recurrence’ ) {
$trp = TRP_Translate_Press::get_trp_instance();
$gettext_manager = $trp->get_component( ‘gettext_manager’ );
$translation_render = $trp->get_component( ‘translation_render’ );// gettext strings (plugin and theme localized strings) $trp_loader->remove_hook( 'init', 'create_gettext_translated_global', $gettext_manager ); $trp_loader->remove_hook( 'init', 'initialize_gettext_processing', $gettext_manager ); $trp_loader->remove_hook( 'shutdown', 'machine_translate_gettext', $gettext_manager ); // user-inputted strings (post title, post content, custom fields etc.) $trp_loader->remove_hook( 'init', 'start_output_buffer', $translation_render ); $trp_loader->remove_hook( 'the_title', 'wrap_with_post_id', $translation_render ); $trp_loader->remove_hook( 'the_content', 'wrap_with_post_id', $translation_render );}
}Could this continual translation of backend contents potentially lead to any performance drawbacks or additional costs (considering API usage for machine translation)?
Potentially yes but it all depends on the quantity of the text. Localized text is usually not very large. The good thing is that each text should be translated only once per language, so repeated calls for the same text to the API translation engine are not an issue. If there’s only certain texts that have this issue, then once it’s been translated for each language, then it shouldn’t cause any more costs or slow downs.Hopefully we were able to answer your questions. Do not hesitate to write back to me if you have further questions.
Best Regards,
Hey there,
Thanks for contacting us!
From what we can tell, You cannot specify additional output handlers if zlib.output_compression is activated . Meaning TranslatePress will not work as it’s built using output buffers.
However, you should probably use HTTP2 & Gzip on a web server level, and this will compress your page, not PHP. It’s faster and better this way.
Regards,
Hello there,
Thanks for reaching out to us!
That URL is handling translation. You are seeing this admin-ajax.php because the trp-ajax.php might be blocked by your host configuration or a security plugin.
As long as you are not seeing this file called on the same string multiple times, everything is working as expected and it should not present any issues.
Let me know if you have further questions.
Hey there,
Thanks for reaching out!
Apologies for not getting back to you any sooner!
If you have, for example, Page A with slug already translated, and create a copy of it, Page A-Copy, is duplicating also the translation of the slug. When you will switch the language will be displayed the Page A translations. In this case, you can just change the translation for the Page A-Copy slug and the redirection will work properly.
Hey there,
We are sorry for not getting back to you any sooner!
Since this looks a lot like a conflict with some other code, the first recommended step is the conflict test (ideally in a staging environment):
Briefly disable all other plugins and enable the default Twenty Twenty theme. Please also disable all add-ons. If this fixes the problem, as it probably will, enable everything one by one, checking each time to see when the problem returns.
Please let us know when you find the conflict so that we can take a look and see what we can do about it.
Hey there,
Thanks for reaching out!
Here are some steps to debug this:
- see if you have any javascript errors in the browser console https://codex.wordpress.org/Using_Your_Browser_to_Diagnose_JavaScript_Errors. A print screen could help.
- if you have any security or minification plugins please deactivate them and try again. Some caching plugins also have minification settings that can break javascript code, so for testing purposes please disable any caching as well.
- try and open the website in a different browser just to exclude a browser add-on that might interfere with javascript.
Let me know about this!
Hello there,
Thanks for reaching out!
If you are not able to translate the link of that specific button you can use our Conditional Shortcode Based On Language to display different buttons for different languages. You can find more details on that here: https://translatepress.com/docs/translation-shortcode/
Hello there,
Thanks for reaching out to us!
This should not be happening, are your translations still available in your database?
You can verify this by checking tables in your database that start with trp_ .
Looking forward to your reply.
Hey there,
Thanks for reaching out to us!
We deeply apologize for the delayed response.
There has been a great load on our team in the past few days, but such a long reply time is very uncommon.
Unfortunately TransaltePress works only on WordPress environment as a plugin. There is no integration for any kind of mobile app at the moment.
Hey there,
Thanks for reaching out to us!
1.This should not be happening, would you mind sharing a link or a couple of screenshots where I can have a better look at this?
2.You can try using our Conditional Shortcode Based On Language to display different content for different languages https://translatepress.com/docs/translation-shortcode/
3.Unfortunately this is only doable using one of our premium features.
Looking forward to your reply.
Hello there,
Thanks for reaching out!
Can you please confirm that you are using the latest version of TranslatePress before we continue?
Greetings,
Please try using the trp_translate() function from here: https://translatepress.com/docs/translation-function/
and let me know if it works.