• Resolved br555

    (@br555)


    Hi,

    I am trying to process translated text in post pages in some custom plugin. For that I added a filter for ‘trp_translated_html’ taking one parameter (priority 200000) as follows:

    add_filter(‘trp_translated_html’, ‘PostTRPHook’, 200000, 1);

    Most of it works well, but I experience some problems with translated bold text, so I assume there is more translate-press processing going on after this filter. So, how can I add a filter for translated post content after all translate-press processing for the page has finished?

    One more question: Is there any translate-press processing that also takes place on client side (that could cause my plugin to miss out this translated text)?

    Thanks

Viewing 1 replies (of 1 total)
  • Hello,

    The hook trp_translated_html should be the last thing we process in TranslatePress. Are those bold issues you mentioned also happening if the filter is not applied?

    Make sure the HTML is valid and correct (for example all tags are closed, you don’t have duplicate attributes on html nodes, you have spaces between attributes, etc) as the HTML parser we use is very sensitive to invalid HTML and can return broken html if it encounters issues.

    As for the front-end, we’re using Javascript’s Mutation Observer. There is no hook there, you’ll probably need to add support your self and wait for changes in the DOM and make your own.

    Cheers,

Viewing 1 replies (of 1 total)
  • The topic ‘process translated page text in plugin’ is closed to new replies.