diff -r 1563d9be4a71 -r 1796e0220bef client/js/main.js --- a/client/js/main.js Fri Apr 19 11:30:33 2013 +0200 +++ b/client/js/main.js Fri Apr 19 13:39:39 2013 +0200 @@ -120,9 +120,6 @@ this.project = new Rkns.Models.Project(); - this.translate = function(_text) { - return (Rkns.i18n[_this.options.language] || Rkns.i18n[_this.options.language.substr(0,2)] || {})[_text] || _text; - } if (typeof this.options.user_id !== "undefined") { this.current_user = this.options.user_id; } @@ -268,11 +265,20 @@ + '<% } %>
' ); +Rkns.Renkan.prototype.translate = function(_text) { + if (Rkns.i18n[this.options.language] && Rkns.i18n[this.options.language][_text]) { + return Rkns.i18n[this.options.language][_text]; + } + if (this.options.language.length > 2 && Rkns.i18n[this.options.language.substr(0,2)] && Rkns.i18n[this.options.language.substr(0,2)][_text]) { + return Rkns.i18n[this.options.language.substr(0,2)][_text]; + } + return _text; +} + Rkns.Renkan.prototype.onStatusChange = function() { this.renderer.onStatusChange(); } - Rkns.Renkan.prototype.setSearchEngine = function(_key) { this.search_engine = this.search_engines[_key]; this.$.find(".Rk-Search-Current").attr("class","Rk-Search-Current " + this.search_engine.getBgClass());