From 5abcbf0eb2a8618106752e46f9e0db2d42580f49 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Mon, 27 Jun 2016 12:03:45 +0200 Subject: [FIX] js: translations and string substitutions _('foo '+bar) does not work as `bar` is a variable with undefinied content during translation export (and variable content during evaluation) so a match will not be found. Also trailing spaces are stripped during synchronisation with transifex. The proper syntax would be _.str.sprintf(_t("foo %s"), bar) but to avoid breaking existing translations (need to reexport .pot) use the syntax _("foo ") + " " + bar that is more stable friendly. The 'No value found for the field...' string is not possible to be fixed without breaking the translations should be split at least twice. Write it the propre way directly. --- addons/web/static/src/js/framework/pyeval.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/web/static/src/js/framework') diff --git a/addons/web/static/src/js/framework/pyeval.js b/addons/web/static/src/js/framework/pyeval.js index 2b553d37e0f..d0708bdf356 100644 --- a/addons/web/static/src/js/framework/pyeval.js +++ b/addons/web/static/src/js/framework/pyeval.js @@ -958,7 +958,7 @@ function eval_arg (arg) { case 'context': case 'compound_context': return pyeval('contexts', [arg]); default: - throw new Error(_t("Unknown nonliteral type " + arg.__ref)); + throw new Error(_t("Unknown nonliteral type ") + ' ' + arg.__ref); } } -- cgit v1.2.3