Hi,

I currently have a little problem to translate contents displayed in a
zc.table component.
Here is an extract of my Python code :

        
        from onf import _
        
        DRAFT          =  0  # New document
        PROPOSED       =  1  # Publication request
        CANCELED       =  2  # Publication request canceled
        REFUSED        =  3  # Publication request refused
        PUBLISHED      =  4  # Publication approved
        
        StateLabels = { 
            DRAFT     : _("status-draft","Draft"),
            PROPOSED  : _("status-proposed","Publication request"),
            CANCELED  : _("status-canceled","Canceled publication
        request"),
            REFUSED   : _("status-refused","Refused publication
        request"),
            PUBLISHED : _("status-published","Published")
        }
        
        class EventManagerSearchForm(BaseForm):
            ...
            columns = (...
              SortableColumn(_('status','Status'),
                lambda c,f:
        StateLabels.get(IWorkflowState(c).getState())),
                       ...)
        
            @Lazy
            def formatter(self):
                return Formatter(self.context, self.request,
                                 self.values(),columns=self.columns)


ZPT is as simple :

        <html i18n:domain="onf">
            ...
            <table tal:replace="structure view/formatter" />
            ...
        </html>


My problem is that the "StateLabels" are translated correctly in several
templates, but not when used inside this table (I can only see the
"status-..." translation key in generated output).
So any help or advise would be very helpful...

Thanks,

  Thierry Florac
-- 
  Chef de projet intranet/internet
  Office National des Forêts - Département Informatique
  2, Avenue de Saint-Mandé
  75570 PARIS Cedex 12
  Mél : [EMAIL PROTECTED]
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85

_______________________________________________
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users

Reply via email to