From 2c6bacc104d08144ff0dc1a04df9de9412454174 Mon Sep 17 00:00:00 2001 From: Mohamed Amine Krout Date: Wed, 18 Sep 2024 14:55:02 +0100 Subject: [PATCH] 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 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 --- .../components/Project/ProjectCardReverse.vue | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/webapps/src/main/webapp/vue-app/tasks-management/components/Project/ProjectCardReverse.vue b/webapps/src/main/webapp/vue-app/tasks-management/components/Project/ProjectCardReverse.vue index 1b67883a9..2f3da89a3 100644 --- a/webapps/src/main/webapp/vue-app/tasks-management/components/Project/ProjectCardReverse.vue +++ b/webapps/src/main/webapp/vue-app/tasks-management/components/Project/ProjectCardReverse.vue @@ -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 }); @@ -141,7 +143,12 @@ export default { },200); } }); - } + }, + getI18N(label){ + const fieldLabelI18NKey = `tasks.status.${label}`; + const fieldLabelI18NValue = this.$t(fieldLabelI18NKey); + return fieldLabelI18NValue === fieldLabelI18NKey ? label : fieldLabelI18NValue; + } } }; \ No newline at end of file