From 46209a876f5e0c31a5ffaa5b194c1f9a571fa0c3 Mon Sep 17 00:00:00 2001 From: awesomerobot Date: Mon, 6 May 2024 12:40:26 -0400 Subject: [PATCH] FIX: don't use fallback key as button text --- javascripts/discourse/components/search-banner.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/javascripts/discourse/components/search-banner.js b/javascripts/discourse/components/search-banner.js index b572077..0fda8d9 100644 --- a/javascripts/discourse/components/search-banner.js +++ b/javascripts/discourse/components/search-banner.js @@ -40,7 +40,17 @@ export default class SearchBanner extends Component { } get buttonText() { - return I18n.t(themePrefix("search_banner.search_button_text")); + const buttonText = themePrefix("search_banner.search_button_text"); + + // this is required for when the English (US) locale is empty + // and the site locale is set to another language + // otherwise the English (US) fallback key is rendered as the button text + // https://meta.discourse.org/t/bug-with-search-banner-search-button-text-shown-in-search-banner-theme-component/273628 + if (buttonText.includes("theme_translations")) { + return false; + } + + return I18n.t(buttonText); } get shouldDisplay() {