I want to change New Topic button text, Create Topic composer button text, and Create a new Topic composer text. I used CSS selectors within a theme. But that has a side effect of changing text when I am replying to someone’s post. Meaning that Reply text also gets changed.
I found a solution of changing text through the Admin console but I want to modify those string from within a string. Is this possible and how to do it?
סיכום מבוסס בינה מלאכותית
In a support discussion titled “Change ‘New Topic’ text,” Usman_Shahid seeks to customize the text of the “New Topic” button and related composer labels via a theme, but finds that using CSS selectors affects unintended elements like the “Reply” button. ondrej suggests using the Admin console under Customise → Text to edit strings like js.topic.create, which works but doesn’t meet Usman’s requirement for theme-based customization. Jagster confirms that modifying core strings via theme is generally not possible without a plugin, as strings reside in core files — though humorously admits they could be wrong. Usman_Shahid later shares a solution: using a theme script to directly modify the I18n.translations object, referencing a Meta Discourse thread for implementation details. The thread concludes that while Admin console editing is straightforward, theme-based string modification is possible via JavaScript manipulation of I18n, offering a more flexible, code-driven approach.
To change text in Discourse just go to admin → Customise → Text and search for js.topic.create. If you search New Topic all other relevant items will appear which you can edit.
I have this solution already. My problem is I want to do this through theme.
AFAIK you can not. Coding a plugin would work. That’s because strings are in core, more or less.
Well, I can be wrong. It has happend every now and then, like last year (with my wife) ![]()
Disclaimer: I will be wrong big time if a theme will change/overwrite those files where those strings are.
The way to do this via theme is to add a script which changes I18n.translations object.
https://meta.discourse.org/t/customize-all-text-in-discourse/36092/68?u=usman_shahid