Skip to content

fix(ui5-li-notification-group, ui5-li-notification): fix i18n bundles usage #3063

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 31, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions packages/fiori/src/NotificationListGroupItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,32 +167,32 @@ class NotificationListGroupItem extends NotificationListItemBase {
}

get overflowBtnAccessibleName() {
return this.i18nBundle.getText(NOTIFICATION_LIST_ITEM_OVERLOW_BTN_TITLE);
return this.i18nFioriBundle.getText(NOTIFICATION_LIST_ITEM_OVERLOW_BTN_TITLE);
}

get closeBtnAccessibleName() {
return this.i18nBundle.getText(NOTIFICATION_LIST_GROUP_ITEM_CLOSE_BTN_TITLE);
return this.i18nFioriBundle.getText(NOTIFICATION_LIST_GROUP_ITEM_CLOSE_BTN_TITLE);
}

get toggleBtnAccessibleName() {
if (this.collapsed) {
return this.i18nBundle.getText(NOTIFICATION_LIST_GROUP_ITEM_TOGGLE_BTN_EXPAND_TITLE);
return this.i18nFioriBundle.getText(NOTIFICATION_LIST_GROUP_ITEM_TOGGLE_BTN_EXPAND_TITLE);
}

return this.i18nBundle.getText(NOTIFICATION_LIST_GROUP_ITEM_TOGGLE_BTN_COLLAPSE_TITLE);
return this.i18nFioriBundle.getText(NOTIFICATION_LIST_GROUP_ITEM_TOGGLE_BTN_COLLAPSE_TITLE);
}

get priorityText() {
if (this.priority === Priority.High) {
return this.i18nBundle.getText(NOTIFICATION_LIST_ITEM_HIGH_PRIORITY_TXT);
return this.i18nFioriBundle.getText(NOTIFICATION_LIST_ITEM_HIGH_PRIORITY_TXT);
}

if (this.priority === Priority.Medium) {
return this.i18nBundle.getText(NOTIFICATION_LIST_ITEM_MEDIUM_PRIORITY_TXT);
return this.i18nFioriBundle.getText(NOTIFICATION_LIST_ITEM_MEDIUM_PRIORITY_TXT);
}

if (this.priority === Priority.Low) {
return this.i18nBundle.getText(NOTIFICATION_LIST_ITEM_LOW_PRIORITY_TXT);
return this.i18nFioriBundle.getText(NOTIFICATION_LIST_ITEM_LOW_PRIORITY_TXT);
}

return "";
Expand All @@ -204,18 +204,18 @@ class NotificationListGroupItem extends NotificationListItemBase {

get readText() {
if (this.read) {
return this.i18nBundle.getText(NOTIFICATION_LIST_ITEM_READ);
return this.i18nFioriBundle.getText(NOTIFICATION_LIST_ITEM_READ);
}

return this.i18nBundle.getText(NOTIFICATION_LIST_ITEM_UNREAD);
return this.i18nFioriBundle.getText(NOTIFICATION_LIST_ITEM_UNREAD);
}

get groupText() {
return this.i18nBundle.getText(NOTIFICATION_LIST_GROUP_ITEM_TXT);
return this.i18nFioriBundle.getText(NOTIFICATION_LIST_GROUP_ITEM_TXT);
}

get counterText() {
const text = this.i18nBundle.getText(NOTIFICATION_LIST_GROUP_ITEM_COUNTER_TXT);
const text = this.i18nFioriBundle.getText(NOTIFICATION_LIST_GROUP_ITEM_COUNTER_TXT);
return this.showCounter ? `${text} ${this.itemsCount}` : "";
}

Expand Down
18 changes: 9 additions & 9 deletions packages/fiori/src/NotificationListItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,18 +222,18 @@ class NotificationListItem extends NotificationListItemBase {

get showMoreText() {
if (this._showMorePressed) {
return this.i18nBundle.getText(NOTIFICATION_LIST_ITEM_SHOW_LESS);
return this.i18nFioriBundle.getText(NOTIFICATION_LIST_ITEM_SHOW_LESS);
}

return this.i18nBundle.getText(NOTIFICATION_LIST_ITEM_SHOW_MORE);
return this.i18nFioriBundle.getText(NOTIFICATION_LIST_ITEM_SHOW_MORE);
}

get overflowBtnAccessibleName() {
return this.i18nBundle.getText(NOTIFICATION_LIST_ITEM_OVERLOW_BTN_TITLE);
return this.i18nFioriBundle.getText(NOTIFICATION_LIST_ITEM_OVERLOW_BTN_TITLE);
}

get closeBtnAccessibleName() {
return this.i18nBundle.getText(NOTIFICATION_LIST_ITEM_CLOSE_BTN_TITLE);
return this.i18nFioriBundle.getText(NOTIFICATION_LIST_ITEM_CLOSE_BTN_TITLE);
}

get hideShowMore() {
Expand Down Expand Up @@ -319,23 +319,23 @@ class NotificationListItem extends NotificationListItemBase {

get priorityText() {
if (this.priority === Priority.High) {
return this.i18nBundle.getText(NOTIFICATION_LIST_ITEM_HIGH_PRIORITY_TXT);
return this.i18nFioriBundle.getText(NOTIFICATION_LIST_ITEM_HIGH_PRIORITY_TXT);
}

if (this.priority === Priority.Medium) {
return this.i18nBundle.getText(NOTIFICATION_LIST_ITEM_MEDIUM_PRIORITY_TXT);
return this.i18nFioriBundle.getText(NOTIFICATION_LIST_ITEM_MEDIUM_PRIORITY_TXT);
}

if (this.priority === Priority.Low) {
return this.i18nBundle.getText(NOTIFICATION_LIST_ITEM_LOW_PRIORITY_TXT);
return this.i18nFioriBundle.getText(NOTIFICATION_LIST_ITEM_LOW_PRIORITY_TXT);
}

return "";
}

get accInvisibleText() {
const notifcationTxt = this.i18nBundle.getText(NOTIFICATION_LIST_ITEM_TXT);
const readTxt = this.read ? this.i18nBundle.getText(NOTIFICATION_LIST_ITEM_READ) : this.i18nBundle.getText(NOTIFICATION_LIST_ITEM_UNREAD);
const notifcationTxt = this.i18nFioriBundle.getText(NOTIFICATION_LIST_ITEM_TXT);
const readTxt = this.read ? this.i18nFioriBundle.getText(NOTIFICATION_LIST_ITEM_READ) : this.i18nFioriBundle.getText(NOTIFICATION_LIST_ITEM_UNREAD);
const priorityText = this.priorityText;

return `${notifcationTxt} ${readTxt} ${priorityText}`;
Expand Down
2 changes: 1 addition & 1 deletion packages/fiori/src/NotificationListItemBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ class NotificationListItemBase extends ListItemBase {
constructor() {
super();

this.i18nBundle = getI18nBundle("@ui5/webcomponents-fiori");
this.i18nFioriBundle = getI18nBundle("@ui5/webcomponents-fiori");
}

static get metadata() {
Expand Down