In a discussion regarding search bar tip text replacement not applying, shapelychops reported that changing default Discourse terms (e.g., Category to Forum) via Site Text did not update the search bar tips, despite verifying the correct Site Text keys. The user noted that the text appeared editable in the console but persisted in the UI, even after cache clearing and waiting. Moin suggested checking for caching issues, while awesomerobot confirmed the issue was reproducible on a test site and suspected a bug where the tip renders before the translation override system can apply changes. zogstrip identified the root cause: certain translations are backed in the JavaScript bundle rather than being lazily evaluated at runtime, making them unmodifiable via the Site Text feature. A fix was proposed in PR #37041 and subsequently merged in PR #38113.
We’re changing some of the default Discourse terms for use in our forum (eg. Category to Forum, Topic to Thread) and ran into an issue with the search bar tips.
I’ve changed what seems to be the correct Site Text, though it’s possible these are not correct since I couldn’t verify it against a translation using enableverboselocalization.
In the attached screenshot, I’ve underlined the text we’re trying to change and circled the site text I suspect is the correct counterpart. Something curious I noticed just before taking this was that when I clicked Edit on js.search.tips.status it showed the text as “filters by topic status” but still had the “edited” highlight on it.
Just to be sure, because this happens as an error from time to time: Is your interface language also English US?
Did you reload after making the change? How long did you wait after making the change? Sometimes it takes a little while because texts are cached.
Hmm there may be a bug here so I’m going to recategorize this, perhaps the tip is rendered before the translation override system can change it? I can reproduce this on a test site as well.
I even cleared cache, restarted my server, tried different browsers, etc… I can call the correct edited translation in the browser console, but it never renders in search.
Our language is set to English US, and I’ve tried both cache refreshing, and good ol’ waiting, as we noticed this yesterday. We were originally thinking that could solve it as well since clicking the search bar, then clicking off it, then clicking back on it in the same session will return a new tip, but it’s possible we just need to be more patient.
This just reminded me of a problem I had a while ago where I had changed the text for the category and tag dropdown, but for days it only worked sometimes.
.
But it looks like it’s not the problem in this case, and I never tried to find out why the texts worked like that.
We guessed it was rendering somewhere else too since it could show different lines without reloading the page, but we hoped it would resolve itself after a short while.
Nice catch, we seem to have a few translations that aren’t dynamically modifiable via the Site Text feature because they’re backed in the JS bundle instead of being lazily evaluated at runtime.
I have a draft PR but I need to ensure it’s not breaking any of the plugins / themes