UX: Add missing title to notifications-button (#27837)
This commit adds the missing title for notifications-button. In the past, it was automatically fallbacked to the button's key. Related meta topic: https://meta.discourse.org/t/tracking-toggle-text-on-hover-sometimes-not-translated/315727
This commit is contained in:
parent
8c5553448a
commit
8d6a2aad18
|
@ -16,16 +16,23 @@ export default DropdownSelectBoxComponent.extend({
|
||||||
i18nPostfix: "",
|
i18nPostfix: "",
|
||||||
},
|
},
|
||||||
|
|
||||||
modifyComponentForRow() {
|
getTitle(key) {
|
||||||
|
const { i18nPrefix, i18nPostfix } = this.selectKit.options;
|
||||||
|
return I18n.t(`${i18nPrefix}.${key}${i18nPostfix}.title`);
|
||||||
|
},
|
||||||
|
|
||||||
|
modifyComponentForRow(_, content) {
|
||||||
|
if (content) {
|
||||||
|
setProperties(content, {
|
||||||
|
title: this.getTitle(content.key),
|
||||||
|
});
|
||||||
|
}
|
||||||
return "notifications-button/notifications-button-row";
|
return "notifications-button/notifications-button-row";
|
||||||
},
|
},
|
||||||
|
|
||||||
modifySelection(content) {
|
modifySelection(content) {
|
||||||
content = content || {};
|
content = content || {};
|
||||||
const { i18nPrefix, i18nPostfix } = this.selectKit.options;
|
const title = this.getTitle(this.buttonForValue.key);
|
||||||
const title = I18n.t(
|
|
||||||
`${i18nPrefix}.${this.buttonForValue.key}${i18nPostfix}.title`
|
|
||||||
);
|
|
||||||
setProperties(content, {
|
setProperties(content, {
|
||||||
title,
|
title,
|
||||||
label: title,
|
label: title,
|
||||||
|
|
Loading…
Reference in New Issue