diff --git a/editor/locale/locale.js b/editor/locale/locale.js
index 2ad5db89..214b038a 100644
--- a/editor/locale/locale.js
+++ b/editor/locale/locale.js
@@ -44,9 +44,9 @@ var put_locale = function(svgCanvas, given_param){
if(data.title)
elem.title = data.title;
if(data.textContent) {
- // Only replace text nodes, not elements
+ // Only replace non-empty text nodes, not elements
$.each(elem.childNodes, function(j, node) {
- if(node.nodeType == 3) {
+ if(node.nodeType == 3 && $.trim(node.textContent)) {
node.textContent = data.textContent;
}
});
diff --git a/editor/svg-editor.html b/editor/svg-editor.html
index 95f14d4f..2fea9dc2 100644
--- a/editor/svg-editor.html
+++ b/editor/svg-editor.html
@@ -87,7 +87,7 @@ script type="text/javascript" src="locale/locale.min.js">
-
-
+ New Image [N]
-
diff --git a/editor/svg-editor.js b/editor/svg-editor.js
index 42df7107..3c607a10 100644
--- a/editor/svg-editor.js
+++ b/editor/svg-editor.js
@@ -2199,7 +2199,10 @@ function svg_edit_setup() {
if(opts.sel && !opts.hidekey) {
var new_title = btn.attr('title').split('[')[0] + '[' + keyval + ']';
key_assocs[keyval] = opts.sel;
- btn.attr('title', new_title);
+ // Disregard for menu items
+ if(!btn.parents('#main_menu').length) {
+ btn.attr('title', new_title);
+ }
}
}
});
@@ -2215,8 +2218,14 @@ function svg_edit_setup() {
},
setTitles: function() {
$.each(key_assocs, function(keyval, sel) {
+ var menu = ($(sel).parents('#main_menu').length);
+
$(sel).each(function() {
- var t = this.title.split(' [')[0];
+ if(menu) {
+ var t = $(this).text().split(' [')[0];
+ } else {
+ var t = this.title.split(' [')[0];
+ }
var key_str = '';
// Shift+Up
$.each(keyval.split('/'), function(i, key) {
@@ -2227,7 +2236,11 @@ function svg_edit_setup() {
}
key_str += (i?'/':'') + mod + (uiStrings['key_'+key] || key);
});
- this.title = t +' ['+key_str+']';
+ if(menu) {
+ this.lastChild.textContent = t +' ['+key_str+']';
+ } else {
+ this.title = t +' ['+key_str+']';
+ }
});
});
}