diff options
| author | Xavier Morel <xmo@openerp.com> | 2012-11-29 15:01:09 +0100 |
|---|---|---|
| committer | Xavier Morel <xmo@openerp.com> | 2012-11-29 15:01:09 +0100 |
| commit | 0b0cfff0630f1453c32fad56f19928fa335bf764 (patch) | |
| tree | 5af1ecfba62fe484dc2df8076f7445bbe03a3e00 /addons/web/static/src/js/dates.js | |
| parent | 184593003b3aec7d40660ae13002f4a4a205fa12 (diff) | |
| parent | 83b7823f257b17403a11908c9b359244635cf0b7 (diff) | |
[MERGE] missing translation marks, courtesy of Csaba TOTH
lp bug: https://launchpad.net/bugs/1084306 fixed
bzr revid: xmo@openerp.com-20121129140109-bwx1njhyqfenc2d3
Diffstat (limited to 'addons/web/static/src/js/dates.js')
| -rw-r--r-- | addons/web/static/src/js/dates.js | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/addons/web/static/src/js/dates.js b/addons/web/static/src/js/dates.js index 3db48c8412a..1a48463df2c 100644 --- a/addons/web/static/src/js/dates.js +++ b/addons/web/static/src/js/dates.js @@ -1,5 +1,6 @@ openerp.web.dates = function(instance) { +var _t = instance.web._t; /** * Converts a string to a Date javascript object using OpenERP's @@ -18,11 +19,11 @@ instance.web.str_to_datetime = function(str) { var regex = /^(\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d)(?:\.\d+)?$/; var res = regex.exec(str); if ( !res ) { - throw new Error("'" + str + "' is not a valid datetime"); + throw new Error(_.str.sprintf(_t("'%s' is not a valid datetime"), str)); } var obj = Date.parseExact(res[1] + " UTC", 'yyyy-MM-dd HH:mm:ss zzz'); if (! obj) { - throw new Error("'" + str + "' is not a valid datetime"); + throw new Error(_.str.sprintf(_t("'%s' is not a valid datetime"), str)); } return obj; }; @@ -45,11 +46,11 @@ instance.web.str_to_date = function(str) { var regex = /^\d\d\d\d-\d\d-\d\d$/; var res = regex.exec(str); if ( !res ) { - throw new Error("'" + str + "' is not a valid date"); + throw new Error(_.str.sprintf(_t("'%s' is not a valid date"), str)); } var obj = Date.parseExact(str, 'yyyy-MM-dd'); if (! obj) { - throw new Error("'" + str + "' is not a valid date"); + throw new Error(_.str.sprintf(_t("'%s' is not a valid date"), str)); } return obj; }; @@ -72,11 +73,11 @@ instance.web.str_to_time = function(str) { var regex = /^(\d\d:\d\d:\d\d)(?:\.\d+)?$/; var res = regex.exec(str); if ( !res ) { - throw new Error("'" + str + "' is not a valid time"); + throw new Error(_.str.sprintf(_t("'%s' is not a valid time"), str)); } var obj = Date.parseExact("1970-01-01 " + res[1], 'yyyy-MM-dd HH:mm:ss'); if (! obj) { - throw new Error("'" + str + "' is not a valid time"); + throw new Error(_.str.sprintf(_t("'%s' is not a valid time"), str)); } return obj; }; |
