js & css fix for CRM-12859
[civicrm-core.git] / js / Common.js
index 8b926423078a1201c684940e0f7d9d4945be65bf..8f5294ef60db3c13e12c62db59dc18e291cfe68b 100644 (file)
@@ -46,9 +46,9 @@ function ts(text, params) {
   text = CRM.strings[text] || text;
   if (typeof(params) === 'object') {
     for (var i in params) {
-      if (typeof(params[i]) === 'string') {
+      if (typeof(params[i]) === 'string' || typeof(params[i]) === 'number') {
         // sprintf emulation: escape % characters in the replacements to avoid conflicts
-        text = text.replace(new RegExp('%' + i, 'g'), params[i].replace(/%/g, '%-crmescaped-'));
+        text = text.replace(new RegExp('%' + i, 'g'), String(params[i]).replace(/%/g, '%-crmescaped-'));
       }
     }
     return text.replace(/%-crmescaped-/g, '%');