FIX: don't use fallback key as button text
This commit is contained in:
parent
58a173be20
commit
46209a876f
|
|
@ -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() {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue