• Resolved boredtaiga

    (@boredtaiga)


    Hi!

    I’ve been trying to translate my site to English and as you can see there are some problems: https://i.imgur.com/9VgXovj.png

    It will display some random strings between my listing-detail_img__3DyYX pos-a-full bg-cover div tags. I was wondering that it might be related to the image translation features of TranslatePress. Is there any ways of disabling it manually in the script, since I’m not in the need of it anyways. I’ve tried all the advanced settings options of TranslatePress already with no help.

    Thanks!

Viewing 14 replies - 1 through 14 (of 14 total)
  • Dragos

    (@dragosvrejiu)

    Hello,

    It should not be related to the image translation feature.
    TranslatePress does not even detect images inserted as background-image.

    Does the string appear only in the secondary language?

    Could you please send me a link to your website?

    Let me know!

    Best regards,

    Thread Starter boredtaiga

    (@boredtaiga)

    Hi!

    Yes it only occurs with the second language.

    https://mapptic.com/en/listing/krog-street-market/

    Thread Starter boredtaiga

    (@boredtaiga)

    I’ve managed to make the second text disappear with custom css.

    Dragos

    (@dragosvrejiu)

    Hi,

    Can you try adding the data-no-translation attribute to the images?

    https://translatepress.com/docs/developers/exclude-certain-text-or-element-from-being-translated/

    Let me know if it changes anything.

    Best regards,

    Thread Starter boredtaiga

    (@boredtaiga)

    Hi!

    Can you help me in doing this? I’ve tried adding the following code into custom header script:

    <script>add_filter( 'trp_no_translate_selectors', 'trpc_no_stranslate_selectors', 10, 2);
    function trpc_no_stranslate_selectors($selectors_array, $language){
        $selectors_array[] = '.listing-detail_img__3DyYX.pos-a-full.bg-cover';
        return $selectors_array;
    }</script>

    but it didn’t actually change anything, I’ve tried adding other elements into this array as well, but all of them still got translated, what am I doing wrong?

    Thanks!

    • This reply was modified 4 years, 9 months ago by boredtaiga.
    • This reply was modified 4 years, 9 months ago by boredtaiga.
    Thread Starter boredtaiga

    (@boredtaiga)

    I’m not entirely sure if this can help in solving the issue, but the following string appears as a translatable text on the top of the background image when using the TranslatePress translator: “”=”” data-trp-translate-id-src=”164″ data-trp-node-group-src=”Images”>”

    And at the top of the site/in the header: “Chorok Baguni”/>” (or anything that is the .listing-detail_text__31u2P

    Dragos

    (@dragosvrejiu)

    Hello,

    Apparently,this is a bug caused by the last update and it will get fixed in the next update of TranslatePress.(Which will be released in one week)

    However,if you need the fix sooner, we can provide a custom code which you can use to fix this.

    Thank you for understanding!

    With the best regards,

    Thread Starter boredtaiga

    (@boredtaiga)

    Hello!

    Thank you for the feedback! We’d really appreciate if you could send us that custom code until the update arrives!

    Thanks for the help!

    Dragos

    (@dragosvrejiu)

    Hi,

    I’m sorry for the delay.

    Here is the code:

    add_action( 'trp_before_running_hooks', 'trpc_remove_hooks_to_disable_search_wraps', 10, 1);
    function trpc_remove_hooks_to_disable_search_wraps( $trp_loader ){
    	$trp                = TRP_Translate_Press::get_trp_instance();
    	$translation_render = $trp->get_component( 'translation_render' );
    	$trp_loader->remove_hook( 'the_title', 'wrap_with_post_id', $translation_render );
    }
    

    Good luck with your project!

    With the best regards,

    Thread Starter boredtaiga

    (@boredtaiga)

    Hi,

    Could you please tell me where to put this code? Tried with the functions.php, but it didn’t work out.

    Thanks in advance!

    Dragos

    (@dragosvrejiu)

    Hi,

    Create an empty plugin like this: https://gist.github.com/sareiodata/76f701e01db6685829db

    Add the following code to the end of it:

    add_action( ‘trp_before_running_hooks’, ‘trpc_remove_hooks_to_disable_search_wraps’, 10, 1);
    function trpc_remove_hooks_to_disable_search_wraps( $trp_loader ){
    $trp = TRP_Translate_Press::get_trp_instance();
    $translation_render = $trp->get_component( ‘translation_render’ );
    $trp_loader->remove_hook( ‘the_title’, ‘wrap_with_post_id’, $translation_render );
    }

    Install this plugin via FTP (copy it inside wp-content/plugins) or create a zip archive with it and install it via the WordPress plugin upload functionality.

    Best regards,

    Thread Starter boredtaiga

    (@boredtaiga)

    Hi!

    Tried this, but sadly it didn’t work this way either. Might this be because of something else is causing the issue? I’ve exchanged information with other people who use the WilCity theme with TranslatePress and they have the same problem. If needed I could give access to the code.

    Dragos

    (@dragosvrejiu)

    Hello,

    Try updating TranslatePress to the latest version and let me know if the issue persists.

    With the best regards,

    Thread Starter boredtaiga

    (@boredtaiga)

    Hi! It works fine now, thanks for the help!

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Random html string showing’ is closed to new replies.