From bfb2cce636e26a2f4cab2da1132a5982be244ed9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sat, 9 Aug 2008 15:22:23 +0200 Subject: [PATCH] Fix translation of global messages for issue240 --- trytond/ir/translation.xml | 9 ++++++--- trytond/osv/orm.py | 8 ++++++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/trytond/ir/translation.xml b/trytond/ir/translation.xml index f007f1c63e..393194e270 100644 --- a/trytond/ir/translation.xml +++ b/trytond/ir/translation.xml @@ -69,26 +69,29 @@ action="act_translation_form" id="menu_translation_form"/> - None + delete_xml_record en_US error You are not allowed to delete this record. + You are not allowed to delete this record. ir - None + xml_record_desc en_US error This record is part of the base configuration. + This record is part of the base configuration. ir - None + write_xml_record en_US error You are not allowed to modify this record. + You are not allowed to modify this record. ir diff --git a/trytond/osv/orm.py b/trytond/osv/orm.py index c4b65ac5a9..c5a8149668 100644 --- a/trytond/osv/orm.py +++ b/trytond/osv/orm.py @@ -626,6 +626,10 @@ class ORM(object): res = translation_obj._get_source(cursor, self._name, 'error', context.get('language', 'en_US'), error) + if not res: + res = translation_obj._get_source(cursor, error, 'error', + context.get('language', 'en_US')) + if res: error = res @@ -638,6 +642,10 @@ class ORM(object): res = translation_obj._get_source(cursor, self._name, 'error', context.get('language', 'en_US'), error_description) + if not res: + res = translation_obj._get_source(cursor, error_description, + 'error', context.get('language', 'en_US')) + if res: error_description = res