From 1b650340451e6c346ef15bb6a4ab66f19be3d749 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Tue, 13 Aug 2013 15:23:25 -0700 Subject: [PATCH] Clarify undo/redo tooltips (fixes #1670) --- data/core.yaml | 8 ++++++-- dist/locales/en.json | 10 ++++++++-- js/id/ui/undo_redo.js | 4 +++- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/data/core.yaml b/data/core.yaml index 58715b25d..135cb1f92 100644 --- a/data/core.yaml +++ b/data/core.yaml @@ -129,8 +129,12 @@ en: multiple: "Split {n} lines/area boundaries." not_eligible: Lines can't be split at their beginning or end. multiple_ways: There are too many lines here to split. - nothing_to_undo: Nothing to undo. - nothing_to_redo: Nothing to redo. + undo: + tooltip: "Undo: {action}" + nothing: Nothing to undo. + redo: + tooltip: "Redo: {action}" + nothing: Nothing to redo. tooltip_keyhint: "Shortcut:" just_edited: "You just edited OpenStreetMap!" browser_notice: "This editor is supported in Firefox, Chrome, Safari, Opera, and Internet Explorer 9 and above. Please upgrade your browser or use Potlatch 2 to edit the map." diff --git a/dist/locales/en.json b/dist/locales/en.json index a247da936..0e16b706b 100644 --- a/dist/locales/en.json +++ b/dist/locales/en.json @@ -166,8 +166,14 @@ "multiple_ways": "There are too many lines here to split." } }, - "nothing_to_undo": "Nothing to undo.", - "nothing_to_redo": "Nothing to redo.", + "undo": { + "tooltip": "Undo: {action}", + "nothing": "Nothing to undo." + }, + "redo": { + "tooltip": "Redo: {action}", + "nothing": "Nothing to redo." + }, "tooltip_keyhint": "Shortcut:", "just_edited": "You just edited OpenStreetMap!", "browser_notice": "This editor is supported in Firefox, Chrome, Safari, Opera, and Internet Explorer 9 and above. Please upgrade your browser or use Potlatch 2 to edit the map.", diff --git a/js/id/ui/undo_redo.js b/js/id/ui/undo_redo.js index a31f6628b..a7917a97a 100644 --- a/js/id/ui/undo_redo.js +++ b/js/id/ui/undo_redo.js @@ -20,7 +20,9 @@ iD.ui.UndoRedo = function(context) { .placement('bottom') .html(true) .title(function (d) { - return iD.ui.tooltipHtml(d.annotation() || t('nothing_to_' + d.id), d.cmd); + return iD.ui.tooltipHtml(d.annotation() ? + t(d.id + '.tooltip', {action: d.annotation()}) : + t(d.id + '.nothing'), d.cmd); }); var buttons = selection.selectAll('button')