From 296f8eb22228481f2b30d604d86657bc26c172c8 Mon Sep 17 00:00:00 2001
From: Sebastien Robin <seb@nexedi.com>
Date: Wed, 3 Sep 2008 08:42:51 +0000
Subject: [PATCH] allow to optionnaly define some columns title that should not
 be translated, this is very usefull when doing some dynamic listbox where
 columns title comes from properties of ERP5 documents and we do not want to
 translate them

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@23359 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5Form/ListBox.py | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/product/ERP5Form/ListBox.py b/product/ERP5Form/ListBox.py
index e839cdc2c1..05c00cede1 100644
--- a/product/ERP5Form/ListBox.py
+++ b/product/ERP5Form/ListBox.py
@@ -300,6 +300,14 @@ class ListBoxWidget(Widget.Widget):
                                  required=0)
     property_names.append('url_columns')
 
+    untranslatable_columns = fields.ListTextAreaField('untranslatable_columns',
+                                 title="Untranslatable Columns",
+                                 description=(
+        "An optional list of columns titles which should not be translated."),
+                                 default=[],
+                                 required=0)
+    property_names.append('untranslatable_columns')
+
     # XXX do we still need this?
     global_attributes = fields.ListTextAreaField('global_attributes',
                                  title="Global Attributes",
@@ -754,6 +762,13 @@ class ListBoxRenderer:
     url_columns = self.field.get_value('url_columns')
     return url_columns or []
 
+  def getUntranslatableColumnList(self):
+    """Return the untranslatable columns. Make sure that it is an empty list, 
+    when not defined.
+    """
+    untranslatable_columns = self.field.get_value('untranslatable_columns')
+    return untranslatable_columns or []
+
   getUrlColumnList = lazyMethod(getUrlColumnList)
 
   def getDefaultSortColumnList(self):
-- 
2.30.9