From 45ae39d6dc085414718c94dc6f722fdaaf95ab08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com> Date: Thu, 25 Nov 2010 13:25:21 +0000 Subject: [PATCH] =?UTF-8?q?do=20not=20encode=20messages=20that=20are=20not?= =?UTF-8?q?=20unicode.=20This=20cause=20problem=20for=20usages=20like=20Ba?= =?UTF-8?q?se=5FtranslateString("h=C3=A9")=20when=20"h=C3=A9"=20is=20not?= =?UTF-8?q?=20translated?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@40687 20353a03-c40f-0410-a6d1-a30d3c3de9de --- .../portal_skins/erp5_core/Base_translateString.xml | 7 ++++++- product/ERP5/bootstrap/erp5_core/bt/revision | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_translateString.xml b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_translateString.xml index 2ceb997722..0ba4caab48 100644 --- a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_translateString.xml +++ b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_translateString.xml @@ -62,9 +62,13 @@ if translation_service is not None :\n try:\n if not encoding:\n return translation_service.translate(catalog, msg, lang=lang, **kw)\n - return translation_service.translate(catalog, msg, lang=lang, **kw).encode(encoding)\n + msg = translation_service.translate(catalog, msg, lang=lang, **kw)\n + if same_type(msg, u\'\'):\n + msg = msg.encode(encoding)\n + return msg\n except AttributeError: # This happens in unit testing, because it is not able to find something with get_context()\n pass\n +\n return msg\n </string> </value> </item> @@ -114,6 +118,7 @@ return msg\n <string>translation_service</string> <string>_apply_</string> <string>_getattr_</string> + <string>same_type</string> <string>AttributeError</string> </tuple> </value> diff --git a/product/ERP5/bootstrap/erp5_core/bt/revision b/product/ERP5/bootstrap/erp5_core/bt/revision index 5147446446..91917fa881 100644 --- a/product/ERP5/bootstrap/erp5_core/bt/revision +++ b/product/ERP5/bootstrap/erp5_core/bt/revision @@ -1 +1 @@ -1798 \ No newline at end of file +1799 \ No newline at end of file -- 2.30.9