From: Aleksander Ɓukasz Date: Wed, 23 Apr 2014 14:48:21 +0000 (+0200) Subject: editor: tweaking some action descriptions X-Git-Url: https://git.mdrn.pl/fnpeditor.git/commitdiff_plain/45c6e40d4312a3bc53fb0c64574d9e5b1f298193?hp=f098ff9873de73d1fd6d71ce64b83ae318e8bd7e editor: tweaking some action descriptions --- diff --git a/src/editor/plugins/core/core.js b/src/editor/plugins/core/core.js index b678ca3..ed0cf28 100644 --- a/src/editor/plugins/core/core.js +++ b/src/editor/plugins/core/core.js @@ -158,7 +158,7 @@ var commentAction = { params.fragment instanceof params.fragment.NodeFragment && !params.fragment.node.isRoot() }; if(state.allowed) { - state.description = gettext('Insert comment after current node'); + state.description = gettext('Insert comment'); } return state; } @@ -310,7 +310,12 @@ var linkAction = { if(params.fragment instanceof params.fragment.CaretFragment) { if(params.fragment.node.isInside('link')) { - return {allowed: true, toggled: true, execute: editLink}; + return { + allowed: true, + toggled: true, + description: gettext('Edit link'), + execute: editLink + }; } } return {allowed: false}; diff --git a/src/editor/plugins/core/lists.js b/src/editor/plugins/core/lists.js index 427673e..0c017f8 100644 --- a/src/editor/plugins/core/lists.js +++ b/src/editor/plugins/core/lists.js @@ -101,6 +101,7 @@ var toggleListAction = function(type) { return false; }; + var label = type === 'Bullet' ? gettext('bull. list') : gettext('num. list'); return { name: 'toggle' + type + 'List', @@ -109,7 +110,7 @@ var toggleListAction = function(type) { fragment: {type: 'context', name: 'fragment'} }, stateDefaults: { - label: type === 'Bullet' ? gettext('bull. list') : gettext('num. list') + label: label }, getState: function(params) { if(!params.fragment || !params.fragment.isValid()) { @@ -121,7 +122,7 @@ var toggleListAction = function(type) { if((list.getClass() === 'list' && type === 'Enum') || (list.getClass() === 'list.enum' && type === 'Bullet')) { return { allowed: true, - description: interpolate(gettext('Change list type to %s'), [type]), + description: interpolate(gettext('Change list type to %s'), [label]), execute: execute.changeType }; } diff --git a/src/editor/plugins/core/switch.js b/src/editor/plugins/core/switch.js index 9b34721..ff49eb8 100644 --- a/src/editor/plugins/core/switch.js +++ b/src/editor/plugins/core/switch.js @@ -14,7 +14,7 @@ var createSwitchAction = function(createParams) { }, getState: function(params) { var state = { - label: this.config.label + label: createParams.to.name }, f = params.fragment, description; @@ -39,7 +39,7 @@ var createSwitchAction = function(createParams) { toSwitch = toSwitch.getParent(createParams.from); } - description = 'Switch to ' + createParams.to.name; + description = gettext('Switch to') + ' ' + createParams.to.name; return _.extend(state, { allowed: !!toSwitch, toggled: alreadyInTarget, diff --git a/src/editor/plugins/core/templates.js b/src/editor/plugins/core/templates.js index 7d6d74f..bca8467 100644 --- a/src/editor/plugins/core/templates.js +++ b/src/editor/plugins/core/templates.js @@ -34,7 +34,7 @@ var insertTemplateAction = { }; } - description = interpolate(gettext('Insert template %s after %s'), [params.template.name, params.fragment.node.getNearestElementNode().getTagName()]); + description = interpolate(gettext('Insert template %s'), [params.template.name]); return { allowed: true, description: description,