From b4eb191a83436080a5cf267ce789f49d1a4894b6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com>
Date: Tue, 3 Jan 2006 11:30:32 +0000
Subject: [PATCH] Translate "New ${portal_type}"

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@4999 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5Form/RelationField.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/product/ERP5Form/RelationField.py b/product/ERP5Form/RelationField.py
index 4be75678a7..991bb5c945 100755
--- a/product/ERP5Form/RelationField.py
+++ b/product/ERP5Form/RelationField.py
@@ -325,7 +325,7 @@ class RelationStringFieldValidator(Validator.StringValidator):
       if translation_service is not None:
         N_ = translation_service.translate
       else :
-        N_ = lambda catalog, msg:msg
+        N_ = lambda catalog, msg, **kw:msg
       # Get the current value
       value = Validator.StringValidator.validate(self, field, key, REQUEST)
       # If the value is the same as the current field value, do nothing
@@ -384,7 +384,9 @@ class RelationStringFieldValidator(Validator.StringValidator):
       menu_item_list = [('', '')]
       new_object_menu_item_list = []
       for p in portal_type:
-        new_object_menu_item_list += [(N_('ui', 'New %s') % N_('ui', p), '%s%s' % (new_content_prefix,p))]
+        new_object_menu_item_list += [(N_('ui', 'New ${portal_type}',
+             mapping={'portal_type':N_('ui', p)}),
+             '%s%s' % (new_content_prefix,p))]
       # If the length is 1, return uid
       if len(relation_list) == 1:
         relation_uid = relation_uid_list[0]
-- 
2.30.9