Add $.format replace to frappe._
This commit is contained in:
parent
80f1a3a071
commit
cfac64a351
1 changed files with 6 additions and 2 deletions
|
|
@ -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._
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue