Skip to content

Commit

Permalink
Fix: Task status labels are not translated on the project details - E…
Browse files Browse the repository at this point in the history
…XO-73978. Prior to this fix, task status labels are not translated in project reverse card, this commit repalbce the translated lebel if exists

Fix: Task status labels are not translated on the project details - EXO-73978.
 Prior to this fix, task status labels are not translated in project reverse card, this commit repalbce the translated lebel if exists
  • Loading branch information
mkrout committed Sep 19, 2024
1 parent 7cfdec3 commit 2c6bacc
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,9 @@ export default {
this.$projectService.getProjectStats(project.id).then(data => {
this.totalLeftTasks = data.totalNumberTasks || 0;
let otherTasksCount = 0;
this.statistics = data.statusStats.sort((a, b) => b.value - a.value);
this.statistics = data.statusStats.sort((a, b) => b.value - a.value).map(item => {
return { ...item, name: this.getI18N(item.name) };
});
if (data.statusStats.length>5){
otherTasksCount= data.statusStats.length-5;
this.statistics.splice(5,otherTasksCount,{ 'name': this.$t('Others'), 'value': otherTasksCount });
Expand All @@ -141,7 +143,12 @@ export default {
},200);
}
});
}
},
getI18N(label){
const fieldLabelI18NKey = `tasks.status.${label}`;
const fieldLabelI18NValue = this.$t(fieldLabelI18NKey);
return fieldLabelI18NValue === fieldLabelI18NKey ? label : fieldLabelI18NValue;
}
}
};
</script>

0 comments on commit 2c6bacc

Please sign in to comment.