Skip to content

Commit

Permalink
Fixed a bug with localization
Browse files Browse the repository at this point in the history
  • Loading branch information
majora2007 committed Aug 11, 2024
1 parent 81c7ba4 commit fb2bf69
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions UI/Web/src/app/_services/action-factory.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,25 +223,28 @@ export class ActionFactoryService {
getActionablesForSettingsPage(actions: Array<ActionItem<any>>, blacklist: Array<Action> = []) {
const tasks = [];

let actionItem;
for (let parent of actions) {
if (parent.action === Action.SendTo) continue;

if (parent.children.length === 0) {
parent.title = translate('actionable.' + parent.title);
if (parent.description !== '') {
parent.description = translate('actionable.' + parent.description);
actionItem = {...parent};
actionItem.title = translate('actionable.' + actionItem.title);
if (actionItem.description !== '') {
actionItem.description = translate('actionable.' + actionItem.description);
}

tasks.push(parent);
tasks.push(actionItem);
continue;
}

for (let child of parent.children) {
child.title = translate('actionable.' + child.title);
if (child.description !== '') {
child.description = translate('actionable.' + child.description);
actionItem = {...child};
actionItem.title = translate('actionable.' + actionItem.title);
if (actionItem.description !== '') {
actionItem.description = translate('actionable.' + actionItem.description);
}
tasks.push(child);
tasks.push(actionItem);
}
}

Expand Down

0 comments on commit fb2bf69

Please sign in to comment.