Gettext strings exclusion (#!trpst#trp-gettext + #TRPLINKPROCESSED)
-
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.
- The topic ‘Gettext strings exclusion (#!trpst#trp-gettext + #TRPLINKPROCESSED)’ is closed to new replies.