diff options
| author | tsabi <> | 2012-11-29 01:22:00 +0100 |
|---|---|---|
| committer | tsabi <> | 2012-11-29 01:22:00 +0100 |
| commit | 92e87f7e6fa762af05b03a6a82d1e135f78172cb (patch) | |
| tree | 00bae01aaccf1e159ba254064542bd58efad85c8 /addons/web/static/src/js/dates.js | |
| parent | 93091dad79c4df972c8686b2fda82547604e8cd5 (diff) | |
Mark strings to be translated.
Maybe some missed, but most of them marked.
bzr revid: tsabi-20121129002200-20tppzvh0ap5tfwe
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; }; |
