• Resolved thwp

    (@thwp)


    Hi all,

    I have a WP website that supports two languages – English and Hebrew.
    Almost 3 weeks ago I started noticing an issue that happened out of the blue, coming and going, in which the Hebrew translation was suddenly not shown, and when switching to English (the default language) the URL in the address bar was appended with the text ‘#TRPLINKPROCESSED‘. Refreshing the page didn’t solve the issue.

    During testing I discovered that the page (the HTML) was injected with the erroneous text ‘#!trpst#trp-gettext‘ in various elements. I’m not sure exactly why it happened, but I knew it was related to TranslatePress’s (TP’s) translation of theme and plugin strings (Gettext strings). So I wanted to stop TP from doing Gettext translations going forward, and also ignore the existing Gettext translations that were already done and saved in the database.

    These were the steps of the solution for me:

    • I checked the option Disable translation for gettext strings in TP settings. (Doing this by itself didn’t really solve the issue, as it was back the next day.)
    • I checked the option Exclude from dynamic translation in TP settings. (The issue kept coming back.)
    • So I wanted to make TP completely ignore Gettext strings, both existing and new, by excluding the conflicting parts. So I did this:
    • I identified all elements with the erroneous text ‘#!trpst#trp-gettext‘ on the page, by searching for this text in Chrome DevTools – Elements tab (HTML view). This was the Gettext translation stuff that was breaking the page…
    • For each such ‘#!trpst#trp-gettext’ instance I found it’s context, meaning whether it’s related to the theme or to a certain plugin.
    • I looked in the database (via phpMyAdmin) at the Gettext table for Hebrew, and searched its ‘domain‘ column for the “TP way” of calling the theme and plugins.
    • I added domain exclusion in TP settings for the theme and relevant plugins, in the Exclude Gettext Strings section. Note that I only used the ‘domain‘ field, leaving the ‘Gettext String’ field empty. This way I was telling TP to exclude ALL Gettext strings related to the theme/plugin. I did that for the theme and for each relevant plugin, one by one, and then saved the changes.
    • The next day, all ‘#!trpst#trp-gettext’ instances were gone except for two, so I excluded them in TP settings (in Exclude selectors from translation option) by their CSS IDs.
    • In further testing the issue was not seen again. (-:

    So that was the way this issue was solved for me. I hope sharing it can help others in similar situations.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thank you for taking the time to share your solution with the WordPress community.

    We appreciate your willingness to help others who may be experiencing a similar issue with TranslatePress.

    Thread Starter thwp

    (@thwp)

    Update:
    I just saw that the last two ‘#!trpst#trp-gettext’ instances mentioned above were back… So I excluded them in?Exclude selectors from translation?option in TP settings by their parent element’s CSS class.
    When I refreshed the page these instances were gone.

    • This reply was modified 1 year, 7 months ago by thwp.
    Thread Starter thwp

    (@thwp)

    Update: #2
    Excluding the parent element was actually not OK, because by excluding it I lost translation that was actually needed… So I rolled back to previous state and excluded the two elements by their CSS IDs again.
    I then realized that I had some JS code that manipulated these two elements’ parent elements, so I ended up changing stuff in my JS code.
    Since I cannot reproduce the issue I’ll have to monitor this website some more, to see if the issue happens again.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Gettext strings exclusion (#!trpst#trp-gettext + #TRPLINKPROCESSED)’ is closed to new replies.