From 732155a028e4c6d8516a981212fcc59b83a3d171 Mon Sep 17 00:00:00 2001 From: Alexis Deveria Date: Tue, 22 Dec 2009 21:24:58 +0000 Subject: [PATCH] Made auto-language-picker only use full translations git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1083 eee81c28-f429-11dd-99c0-75d572ba1ddd --- editor/locale/locale.js | 9 ++++++++- editor/svg-editor.html | 4 ++-- editor/svg-editor.js | 2 -- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/editor/locale/locale.js b/editor/locale/locale.js index 24770067..94efab03 100644 --- a/editor/locale/locale.js +++ b/editor/locale/locale.js @@ -8,6 +8,7 @@ */ var put_locale = function(svgCanvas, given_param){ var lang_param; + var good_langs = ['cs','nl','en','es','fr','ro','sk']; if(given_param) { lang_param = given_param; } else { @@ -20,8 +21,14 @@ var put_locale = function(svgCanvas, given_param){ if (lang_param == "") return; } - // don't bother on first run if language is English lang_param = String(lang_param); + + // Set to English if language is not in list of good langs + if($.inArray(lang_param, good_langs) == -1) { + lang_param = "en"; + } + + // don't bother on first run if language is English if(lang_param.indexOf("en") == 0) return; } diff --git a/editor/svg-editor.html b/editor/svg-editor.html index 8f53d49f..da7ff59e 100644 --- a/editor/svg-editor.html +++ b/editor/svg-editor.html @@ -427,11 +427,11 @@ script type="text/javascript" src="locale/locale.min.js"> diff --git a/editor/svg-editor.js b/editor/svg-editor.js index ecc8aa82..2b2b9b26 100644 --- a/editor/svg-editor.js +++ b/editor/svg-editor.js @@ -2131,9 +2131,7 @@ function svg_edit_setup() { var t = this.title.split(' [')[0]; var key_str = ''; // Shift+Up - console.log('keyval',keyval) $.each(keyval.split('/'), function(i, key) { - console.log('key',key); var mod_bits = key.split('+'), mod = ''; if(mod_bits.length > 1) { mod = mod_bits[0] + '+';