From 4fb5ae332b1431109f239548da7da44cc69d50d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Barrag=C3=A1n=20Merino?= Date: Tue, 28 Apr 2015 13:46:33 +0200 Subject: [PATCH] [i18n] Fix backlog and taskboard charts --- app/coffee/modules/backlog/main.coffee | 34 +++++++++------ app/coffee/modules/taskboard/charts.coffee | 12 ++++-- app/locales/locale-en.json | 6 ++- app/locales/locale-es.json | 16 ++++--- app/locales/locale-fr.json | 49 +++++++++++++++++++++- app/partials/backlog/backlog.jade | 24 ++++++++--- 6 files changed, 110 insertions(+), 31 deletions(-) diff --git a/app/coffee/modules/backlog/main.coffee b/app/coffee/modules/backlog/main.coffee index aa337b5f..9ce9d986 100644 --- a/app/coffee/modules/backlog/main.coffee +++ b/app/coffee/modules/backlog/main.coffee @@ -871,11 +871,12 @@ UsPointsDirective = ($tgEstimationsService, $repo, $tgTemplate) -> module.directive("tgBacklogUsPoints", ["$tgEstimationsService", "$tgRepo", "$tgTemplate", UsPointsDirective]) + ############################################################################# ## Burndown graph directive ############################################################################# -tgBacklogGraphDirective = ($translate) -> +BurndownBacklogGraphDirective = ($translate) -> redrawChart = (element, dataToDraw) -> width = element.width() element.height(width/6) @@ -931,13 +932,20 @@ tgBacklogGraphDirective = ($translate) -> } xaxis: { ticks: dataToDraw.milestones.length - axisLabel: "Sprints" + axisLabel: $translate.instant("BACKLOG.CHART.XAXIS_LABEL"), axisLabelUseCanvas: true - axisLabelFontSizePixels: 14 + axisLabelFontSizePixels: 12 axisLabelFontFamily: "Verdana, Arial, Helvetica, Tahoma, sans-serif" - axisLabelPadding: 15 + axisLabelPadding: 5 tickFormatter: (val, axis) -> "" } + yaxis: { + axisLabel: $translate.instant("BACKLOG.CHART.YAXIS_LABEL"), + axisLabelUseCanvas: true + axisLabelFontSizePixels: 12 + axisLabelFontFamily: "Verdana, Arial, Helvetica, Tahoma, sans-serif" + axisLabelPadding: 5 + } series: { shadowSize: 0 lines: { @@ -956,16 +964,17 @@ tgBacklogGraphDirective = ($translate) -> tooltipOpts: { content: (label, xval, yval, flotItem) -> if flotItem.seriesIndex == 1 - return $translate.instant("BACKLOG.CHART.OPTIMAL", {xval: xval, yval: yval}) - + ctx = {xval: xval, yval: yval} + return $translate.instant("BACKLOG.CHART.OPTIMAL", ctx) else if flotItem.seriesIndex == 2 - return $translate.instant("BACKLOG.CHART.REAL", {xval: xval, yval: yval}) - + ctx = {xval: xval, yval: yval} + return $translate.instant("BACKLOG.CHART.REAL", ctx) else if flotItem.seriesIndex == 3 - return $translate.instant("BACKLOG.CHART.INCREMENT_TEAM", {xval: xval, yval: Math.abs(yval)}) - + ctx = {xval: xval, yval: Math.abs(yval)} + return $translate.instant("BACKLOG.CHART.INCREMENT_TEAM", ctx) else - return $translate.instant("BACKLOG.CHART.INCREMENT_CLIENT", {xval: xval, yval: Math.abs(yval)}) + ctx = {xval: xval, yval: Math.abs(yval)} + return $translate.instant("BACKLOG.CHART.INCREMENT_CLIENT", ctx) } } @@ -987,8 +996,7 @@ tgBacklogGraphDirective = ($translate) -> return {link: link} - -module.directive("tgGmBacklogGraph", ["$translate", tgBacklogGraphDirective]) +module.directive("tgBurndownBacklogGraph", ["$translate", BurndownBacklogGraphDirective]) ############################################################################# diff --git a/app/coffee/modules/taskboard/charts.coffee b/app/coffee/modules/taskboard/charts.coffee index 20098ab4..cf0c2ee1 100644 --- a/app/coffee/modules/taskboard/charts.coffee +++ b/app/coffee/modules/taskboard/charts.coffee @@ -34,7 +34,7 @@ module = angular.module("taigaTaskboard") ## Sprint burndown graph directive ############################################################################# -SprintGraphDirective = -> +SprintGraphDirective = ($translate)-> redrawChart = (element, dataToDraw) -> width = element.width() element.height(240) @@ -64,13 +64,18 @@ SprintGraphDirective = -> max: _.last(days) mode: "time" daysNames: days - axisLabel: 'Day' + axisLabel: $translate.instant("TASKBOARD.CHARTS.XAXIS_LABEL") axisLabelUseCanvas: true axisLabelFontSizePixels: 12 axisLabelFontFamily: 'Verdana, Arial, Helvetica, Tahoma, sans-serif' axisLabelPadding: 5 yaxis: min: 0 + axisLabel: $translate.instant("TASKBOARD.CHARTS.YAXIS_LABEL") + axisLabelUseCanvas: true + axisLabelFontSizePixels: 12 + axisLabelFontFamily: 'Verdana, Arial, Helvetica, Tahoma, sans-serif' + axisLabelPadding: 5 series: shadowSize: 0 lines: @@ -127,5 +132,4 @@ SprintGraphDirective = -> return {link: link} - -module.directive("tgSprintGraph", SprintGraphDirective) +module.directive("tgSprintGraph", ["$translate", SprintGraphDirective]) diff --git a/app/locales/locale-en.json b/app/locales/locale-en.json index d29b8ca9..65d3ed64 100644 --- a/app/locales/locale-en.json +++ b/app/locales/locale-en.json @@ -606,6 +606,8 @@ "SORTABLE_FILTER_ERROR": "You can't drop on backlog when filters are open", "DOOMLINE": "Project Scope [Doomline]", "CHART": { + "XAXIS_LABEL": "Sprints", + "YAXIS_LABEL": "Points", "OPTIMAL": "Optimal pending points for sprint {{xval}} should be {{yval}}", "REAL": "Real pending points for sprint {{xval}} is {{yval}}", "INCREMENT_TEAM": "Incremented points by team requirements for sprint {{xval}} is {{yval}}", @@ -676,7 +678,9 @@ "ROW_UNASSIGED_TASKS_TITLE": "Unassigned tasks" }, "CHARTS": { - "OPTIMAL": "Optimal pending points for day #{formattedDate} should be {{roundedValue}}", + "XAXIS_LABEL": "Days", + "YAXIS_LABEL": "Points", + "OPTIMAL": "Optimal pending points for day {{formattedDate}} should be {{roundedValue}}", "REAL": "Real pending points for day {{formattedDate}} is {{roundedValue}}" } }, diff --git a/app/locales/locale-es.json b/app/locales/locale-es.json index b00da866..571f804b 100644 --- a/app/locales/locale-es.json +++ b/app/locales/locale-es.json @@ -603,10 +603,12 @@ "SORTABLE_FILTER_ERROR": "No puedes arrastrar historias en el backlog cuando los filtros están en uso", "DOOMLINE": "Alcance del proyecto (línea de la fatalidad :-P)", "CHART": { - "OPTIMAL": "Los puntos pendientes optimos para el sprint {{xval}} deben ser {{yval}}", - "REAL": "Los puntos pendientes reales para el sprint {{xval}} son {{yval}}", - "INCREMENT_TEAM": "Puntos incrementados por requerimientos del equipo para el sprint {{xval}} es {{yval}}", - "INCREMENT_CLIENT": "Puntos incrementados por requerimientos del cliente para el sprint {{xval}} es {{yval}}" + "XAXIS_LABEL": "Sprints", + "YAXIS_LABEL": "Puntos", + "OPTIMAL": "El número de puntos óptimos pendientes para el sprint {{xval}} debería ser de {{yval}}", + "REAL": "El número real de puntos pendientes para el sprint {{xval}} es de {{yval}}", + "INCREMENT_TEAM": "El número de puntos incrementados por requerimientos del equipo para el sprint {{xval}} es de {{yval}}", + "INCREMENT_CLIENT": "El número de puntos incrementados por requerimientos del cliente para el sprint {{xval}} es de {{yval}}" }, "TAGS": { "SHOW": "Mostrar etiquetas", @@ -673,8 +675,10 @@ "ROW_UNASSIGED_TASKS_TITLE": "Tareas no asignadas" }, "CHARTS": { - "OPTIMAL": "Los puntos pendientes óptimos para el día #{formattedDate} deben ser {{roundedValue}}", - "REAL": "Los puntos reales pendientes para el día {{formattedDate}} son {{roundedValue}}" + "XAXIS_LABEL": "Días", + "YAXIS_LABEL": "Puntos", + "OPTIMAL": "El número de puntos óptimos pendientes para el día {{formattedDate}} debería ser de {{roundedValue}}", + "REAL": "El número de puntos pendientes para el día {{formattedDate}} es de {{roundedValue}}" } }, "TASK": { diff --git a/app/locales/locale-fr.json b/app/locales/locale-fr.json index c365966e..1c761f7c 100644 --- a/app/locales/locale-fr.json +++ b/app/locales/locale-fr.json @@ -119,6 +119,46 @@ "PREVIEW_BUTTON": "Prévisualiser", "EDIT_BUTTON": "Éditer", "MARKDOWN_HELP": "Aide sur la syntaxe Markdown" + }, + "PERMISIONS_CATEGORIES": { + "SPRINTS": { + "NAME": "Sprints", + "VIEW_SPRINTS": "View sprints", + "ADD_SPRINTS": "Add sprints", + "MODIFY_SPRINTS": "Modify sprints", + "DELETE_SPRINTS": "Delete sprints" + }, + "USER_STORIES": { + "NAME": "User Stories", + "VIEW_USER_STORIES": "View user stories", + "ADD_USER_STORIES": "Add user stories", + "MODIFY_USER_STORIES": "Modify user stories", + "DELETE_USER_STORIES": "Delete user stories" + }, + "TASKS": { + "NAME": "Tasks", + "VIEW_TASKS": "View tasks", + "ADD_TASKS": "Add tasks", + "MODIFY_TASKS": "Modify tasks", + "DELETE_TASKS": "Delete tasks" + }, + "ISSUES": { + "NAME": "Issues", + "VIEW_ISSUES": "View issues", + "ADD_ISSUES": "Add issues", + "MODIFY_ISSUES": "Modify issues", + "DELETE_ISSUES": "Delete issues" + }, + "WIKI": { + "NAME": "Wiki", + "VIEW_WIKI_PAGES": "View wiki pages", + "ADD_WIKI_PAGES": "Add wiki pages", + "MODIFY_WIKI_PAGES": "Modify wiki pages", + "DELETE_WIKI_PAGES": "Delete wiki pages", + "VIEW_WIKI_LINKS": "View wiki links", + "ADD_WIKI_LINKS": "Add wiki links", + "DELETE_WIKI_LINKS": "Delete wiki links" + } } }, "AUTH": { @@ -265,7 +305,8 @@ "TITLE_DELETE_ROLE": "Supprimer des rôles", "REPLACEMENT_ROLE": "Tous les utilisateurs avec ce rôle seront déplacés dans", "WARNING_DELETE_ROLE": "Attention, toutes les estimations de role seront supprimées", - "ERROR_DELETE_ALL": "Vous ne pouvez pas supprimer toutes les valeurs" + "ERROR_DELETE_ALL": "Vous ne pouvez pas supprimer toutes les valeurs", + "EXTERNAL_USER": " " }, "THIRD_PARTIES": { "SECRET_KEY": "Clé secrète", @@ -562,6 +603,8 @@ "SORTABLE_FILTER_ERROR": "Vous ne pouvez pas glisser-déposer quand les filtres sont ouverts", "DOOMLINE": "Périmètre projet", "CHART": { + "XAXIS_LABEL": "Sprints", + "YAXIS_LABEL": "Points", "OPTIMAL": "Le nombre optimal de points en attente pour le sprint {{xval}} devrait être {{yval}}", "REAL": "Le nombre réel de points pour le sprint {{xval}} est {{yval}}", "INCREMENT_TEAM": "Le nombre de points ajoutés par les exigences de l'équipe pour le sprint {{xval}} est {{yval}}", @@ -632,7 +675,9 @@ "ROW_UNASSIGED_TASKS_TITLE": "Tâches non assignées" }, "CHARTS": { - "OPTIMAL": "Le nombre optimal de points pour le jour #{formattedDate} devrait être {{roundedValue}}", + "XAXIS_LABEL": "Journées", + "YAXIS_LABEL": "Points", + "OPTIMAL": "Le nombre optimal de points pour le jour {{formattedDate}} devrait être {{roundedValue}}", "REAL": "Le nombre réel de points pour le jour {{formattedDate}} est {{roundedValue}}" } }, diff --git a/app/partials/backlog/backlog.jade b/app/partials/backlog/backlog.jade index 4dfe864a..fd0d9273 100644 --- a/app/partials/backlog/backlog.jade +++ b/app/partials/backlog/backlog.jade @@ -8,27 +8,41 @@ div.wrapper(tg-backlog, ng-controller="BacklogController as ctrl", section.main.backlog include ../includes/components/mainTitle include ../includes/components/summary + div.graphics-container.burndown-container - div.burndown(tg-gm-backlog-graph) + div.burndown(tg-burndown-backlog-graph) include ../includes/modules/burndown + div.backlog-menu div.backlog-table-options - a.trans-button.move-to-current-sprint(href="", title="{{'BACKLOG.MOVE_US_TO_CURRENT_SPRINT' | translate}}", id="move-to-current-sprint") + a.trans-button.move-to-current-sprint(href="", + title="{{'BACKLOG.MOVE_US_TO_CURRENT_SPRINT' | translate}}", + id="move-to-current-sprint") span.icon.icon-move span.text(translate="BACKLOG.MOVE_US_TO_CURRENT_SPRINT") - a.trans-button(href="", title="{{'BACKLOG.SHOW_FILTERS' | translate}}", id="show-filters-button") + a.trans-button(href="", + title="{{'BACKLOG.SHOW_FILTERS' | translate}}", + id="show-filters-button") span.icon.icon-filter span.text(translate="BACKLOG.SHOW_FILTERS") Show Filters - a.trans-button(href="", title="{{'BACKLOG.SHOW_TAGS' | translate}}", id="show-tags") + a.trans-button(href="", + title="{{'BACKLOG.SHOW_TAGS' | translate}}", + id="show-tags") span.icon.icon-tag span.text(translate="BACKLOG.SHOW_TAGS") include ../includes/components/addnewus + section.backlog-table(ng-class="{'hidden': !visibleUserstories.length}") include ../includes/modules/backlog-table + div.empty.empty-backlog(ng-class="{'hidden': visibleUserstories.length}", tg-backlog-empty-sortable) span.icon.icon-backlog span.title(translate="BACKLOG.EMPTY") - a(href="", title="{{'BACKLOG.CREATE_NEW_US' | translate}}", ng-click="ctrl.addNewUs('standard')", tg-check-permission="add_us", translate="BACKLOG.CREATE_NEW_US_EMPTY_HELP") + a(href="", title="{{'BACKLOG.CREATE_NEW_US' | translate}}", + ng-click="ctrl.addNewUs('standard')", + tg-check-permission="add_us", + translate="BACKLOG.CREATE_NEW_US_EMPTY_HELP") + sidebar.menu-secondary.sidebar include ../includes/modules/sprints