Fixed locale issues for main menu (will work once lang files are updated)
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1218 eee81c28-f429-11dd-99c0-75d572ba1dddmaster
parent
d360c991cd
commit
b835da83ea
|
@ -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;
|
||||
}
|
||||
});
|
||||
|
|
|
@ -87,7 +87,7 @@ script type="text/javascript" src="locale/locale.min.js"></script-->
|
|||
<ul>
|
||||
<li id="tool_clear">
|
||||
<div></div>
|
||||
<label>New Image [N]</label>
|
||||
New Image [N]
|
||||
</li>
|
||||
|
||||
<li id="tool_open" style="display:none;">
|
||||
|
|
|
@ -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+']';
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue