From f07d97472f03f2a402cf9857737a785c51cbd635 Mon Sep 17 00:00:00 2001
From: Kevin Deldycke <kevin@nexedi.com>
Date: Wed, 25 Jan 2006 18:12:41 +0000
Subject: [PATCH] By default, the default message is the message itself

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@5322 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5Type/patches/Localizer.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/product/ERP5Type/patches/Localizer.py b/product/ERP5Type/patches/Localizer.py
index e3f98e69cb..63c00303af 100755
--- a/product/ERP5Type/patches/Localizer.py
+++ b/product/ERP5Type/patches/Localizer.py
@@ -12,6 +12,9 @@
 #
 ##############################################################################
 
+from Products.CMFCore.utils import getToolByName
+
+
 # Template() is a new method of python 2.4, that's why we have the string.py
 #   file in ERP5Form.
 try:
@@ -35,7 +38,7 @@ class LocalizerTranslationService:
                               }
 
     # Get Localizer
-    localizer = context.getPortalObject().Localizer
+    localizer = getToolByName(context, 'Localizer')
     # Get the Localizer catalog id
     catalog_id = None
     if domain in message_catalog_aliases.keys():
@@ -47,7 +50,8 @@ class LocalizerTranslationService:
       return msgid
     catalog_obj = localizer[catalog_id]
     # Adapt Translation Service default value to the Localizer one
-    if default == None: default = []
+    if default == None:
+      default = msgid
     # Call the Message Catalog gettext method
     translated_str = catalog_obj.gettext( message = msgid
                                         , lang    = target_language
-- 
2.30.9