Commit 296f8eb2 authored by Sebastien Robin's avatar Sebastien Robin

allow to optionnaly define some columns title that should not be translated,...

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
parent a2200ffb
......@@ -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):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment