[facet] control i18nization of values on AttributeFacet stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Mon, 17 May 2010 11:04:52 +0200
branchstable
changeset 5526 4fcb0c132098
parent 5525 c4eee9921e19
child 5527 01a7228ab5a0
child 5528 5d1b2ae7d459
[facet] control i18nization of values on AttributeFacet
web/facet.py
--- a/web/facet.py	Sun May 16 19:00:07 2010 +0200
+++ b/web/facet.py	Mon May 17 11:04:52 2010 +0200
@@ -467,6 +467,7 @@
     attrtype = 'String'
     # type of comparison: default is an exact match on the attribute value
     comparator = '=' # could be '<', '<=', '>', '>='
+    i18nable = True
 
     def vocabulary(self):
         """return vocabulary for this facet, eg a list of 2-uple (label, value)
@@ -491,7 +492,10 @@
         return rset and self.rset_vocabulary(rset)
 
     def rset_vocabulary(self, rset):
-        _ = self._cw._
+        if self.i18nable:
+            _ = self._cw._
+        else:
+            _ = unicode
         return [(_(value), value) for value, in rset]
 
     def support_and(self):