Can you customize/override core text with a theme component?

AI-generated summary

Customizing Core Text with a Theme Component

The discussion revolves around customizing core text using a theme component. JonahAragon1 is trying to replace the text js.search.or_search_google with a theme component without manually customizing it in the admin panel.

Lilly suggests using text replacement, while Don explains that the theme component overrides a specific template, which doesn’t include the text JonahAragon1 wants to change. Don provides the location of the text in the core code and suggests that the easiest way to change it is through the /admin/customize/site_texts/ page.

JonahAragon1 clarifies that they want to simplify the process for users who install the theme component, but acknowledges that manual text replacement may be necessary.

I have a theme component which replaces components/google-search with a box that searches DuckDuckGo instead, simple enough. I can’t figure out how to make the theme component change/replace this text (js.search.or_search_google) though:

Is this possible to do without just customizing the text manually in the admin panel?

Hi @JonahAragon1 :wave: You can do this with text replacement

Hello :wave:

This component is override the google-search template which is this area. :arrow_down_small:

So it won’t change the text above this.

The component contains a locale file where the same text appears but this is for the input field area-label
https://github.com/privacyguides/discourse-duckduckgo-search/blob/1beeff099b7e2abd5009df5bc2029be6158e5d47/locales/en.yml#L3


The text you want to change is found here in core :arrow_down_small:


The easiest way to change this text is on the /admin/customize/site_texts/ page.

Well, I was just trying to make it so the manual text replacement isn’t necessary when you install the theme component, to save a step for anyone who installs it.

If that’s not easily possible, then it’s not the end of the world I guess. Thanks!