seitime-frappe/public/js/wn/translate.js

15 lines
No EOL
379 B
JavaScript

// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
// MIT License. See license.txt
// for translation
wn._messages = {};
wn._ = function(txt) {
if(!txt) return txt;
if(typeof(txt) != "string") return txt;
return wn._messages[txt.replace(/\n/g, "")] || txt;
};
wn.translate = function(obj, keys) {
$.each(keys, function(i, key) {
obj["_" + key] = wn._(obj[key]);
})
}