From 86be9abb62ab73089e1b891412c519de9989a3c8 Mon Sep 17 00:00:00 2001 From: yflory Date: Wed, 16 May 2018 16:45:16 +0200 Subject: [PATCH] Translations for kanban --- customize.dist/translations/messages.fr.js | 9 +++++ customize.dist/translations/messages.js | 8 ++++- www/kanban/inner.js | 41 +++++++++------------- 3 files changed, 33 insertions(+), 25 deletions(-) diff --git a/customize.dist/translations/messages.fr.js b/customize.dist/translations/messages.fr.js index 0259d5668..f2f3feb21 100644 --- a/customize.dist/translations/messages.fr.js +++ b/customize.dist/translations/messages.fr.js @@ -248,6 +248,15 @@ define(function () { out.pad_mediatagWidth = "Largeur (px)"; out.pad_mediatagHeight = "Hauteur (px)"; + // Kanban + out.kanban_newBoard = "Nouveau tableau"; + out.kanban_item = "Élément {0}"; // Item number for initial content + out.kanban_todo = "À faire"; + out.kanban_done = "Terminé"; + out.kanban_working = "En cours"; + out.kanban_deleteBoard = "Êtes-vous sûr de vouloir supprimer ce tableau ?"; + out.kanban_deleteItem = "Êtes-vous sûr de vouloir supprimer cet élément?"; + // Polls out.poll_title = "Sélecteur de date Zero Knowledge"; diff --git a/customize.dist/translations/messages.js b/customize.dist/translations/messages.js index 5fdee8948..114fb6249 100644 --- a/customize.dist/translations/messages.js +++ b/customize.dist/translations/messages.js @@ -251,7 +251,13 @@ define(function () { out.pad_mediatagHeight = "Height (px)"; // Kanban - out.kanban_title = "Kanban"; + out.kanban_newBoard = "New board"; + out.kanban_item = "Item {0}"; // Item number for initial content + out.kanban_todo = "To Do"; + out.kanban_done = "Done"; + out.kanban_working = "Working"; + out.kanban_deleteBoard = "Are you sure you want to delete this board?"; + out.kanban_deleteItem = "Are you sure you want to delete this item?"; // Polls diff --git a/www/kanban/inner.js b/www/kanban/inner.js index 29ef86b59..25634c0d4 100644 --- a/www/kanban/inner.js +++ b/www/kanban/inner.js @@ -25,35 +25,32 @@ define([ // Kanban code var initKanban = function (framework, boards) { - var defaultBoards = [{ // XXX + var defaultBoards = [{ "id": "todo", - "title": "To Do", + "title": Messages.kanban_todo, "color": "blue", - "item": [ - { - "title": "Item 1" - }, - { - "title": "Item 2" - } - ] + "item": [{ + "title": Messages._getKey('kanban_item', [1]) + }, { + "title": Messages._getKey('kanban_item', [2]) + }] }, { "id": "working", - "title": "Working", + "title": Messages.kanban_working, "color": "orange", "item": [{ - "title": "Item 3", + "title": Messages._getKey('kanban_item', [3]) }, { - "title": "Item 4", + "title": Messages._getKey('kanban_item', [4]) }] }, { "id": "done", - "title": "Done", + "title": Messages.kanban_done, "color": "green", "item": [{ - "title": "Item 5", + "title": Messages._getKey('kanban_item', [5]) }, { - "title": "Item 6", + "title": Messages._getKey('kanban_item', [6]) }] }]; @@ -154,12 +151,10 @@ define([ }, removeClick: function (el, boardId) { - // XXX - UI.confirm("Do you want to delete this board?", function (yes) { + UI.confirm(Messages.kanban_deleteBoard, function (yes) { if (!yes) { return; } console.log("Delete board"); var boardName = $(el.parentNode.parentNode).attr("data-id"); - console.log(boardName, boardId); // TODO for (var index in kanban.options.boards) { if (kanban.options.boards[index].id === boardName) { break; @@ -195,9 +190,8 @@ define([ addItemButton: true, boards: boards, dragcancelEl: function (el, boardId) { - // XXX var pos = kanban.findElementPosition(el); - UI.confirm("Are you sure...??", function (yes) { + UI.confirm(Messages.kanban_deleteItem, function (yes) { if (!yes) { return; } var board; kanban.options.boards.some(function (b) { @@ -222,13 +216,12 @@ define([ counter++; } - // XXX kanban.addBoards([{ "id": "board" + counter, - "title": "New Board", + "title": Messages.kanban_newBoard, "color": "yellow", "item": [{ - "title": "Item 1", + "title": Messages._getKey('kanban_item', [1]), }] }]); kanban.onChange();