Add $.format replace to frappe._

This commit is contained in:
Pratik Vyas 2014-04-14 16:02:40 +05:30
parent 80f1a3a071
commit cfac64a351

View file

@ -6,6 +6,10 @@ frappe._messages = {};
frappe._ = function(txt, replace) {
if(!txt) return txt;
if(typeof(txt) != "string") return txt;
return frappe._messages[txt.replace(/\n/g, "")] || txt;
ret = frappe._messages[txt.replace(/\n/g, "")] || txt;
if(replace && typeof(replace) === "object") {
ret = $.format(ret, replace);
}
return ret;
};
window.__ = frappe._
window.__ = frappe._