Skip to content

Commit

Permalink
FIX: don't use fallback key as button text (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
awesomerobot authored May 6, 2024
1 parent 58a173b commit 9173272
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion javascripts/discourse/components/search-banner.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,16 @@ export default class SearchBanner extends Component {
}

get buttonText() {
return I18n.t(themePrefix("search_banner.search_button_text"));
const buttonText = I18n.t(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 buttonText;
}

get shouldDisplay() {
Expand Down

0 comments on commit 9173272

Please sign in to comment.