FIX: don't use fallback key as button text

This commit is contained in:
awesomerobot 2024-05-06 12:40:26 -04:00
parent 58a173be20
commit 46209a876f
1 changed files with 11 additions and 1 deletions

View File

@ -40,7 +40,17 @@ export default class SearchBanner extends Component {
} }
get buttonText() { 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() { get shouldDisplay() {