From b835da83ea7e46037e3b6fa3e2055c3eb0368bb1 Mon Sep 17 00:00:00 2001 From: Alexis Deveria Date: Thu, 14 Jan 2010 16:05:05 +0000 Subject: [PATCH] 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-75d572ba1ddd --- editor/locale/locale.js | 4 ++-- editor/svg-editor.html | 2 +- editor/svg-editor.js | 19 ++++++++++++++++--- 3 files changed, 19 insertions(+), 6 deletions(-) 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">