[Zope3-Users] Little problem with I18n properties

Thierry Florac thierry.florac at onf.fr
Mon Nov 20 06:12:11 EST 2006


  Hi,

I currently have a little silly problem with I18n properties handling.
I have a form where I want to display a string which is a concatenation
of two strings : a first one which is extracted from a translatable
content, and a second one which is the form's title.
My code is as follow :

BaseForm.py :

        class BaseForm(formlib.EditForm):
          @property
          def title(self):
            return "%s: %s" %
        (II18n(self.context).queryAttribute('title'),
                               self._title)

CurrentForm.py

        class MyEditForm(BaseForm):
          _title = _("Modify context properties")

Form.pt :
        <fieldset>
        <legend tal:content="structure string:&nbsp;
        ${view/title}&nbsp;" />
          ...
        </fieldset>


The problem is simple : the first part of the computed title is
translated correctly via I18n, but not the second one.
I also checked a few thinks :
 - if I only put, in my form template, "view/_title", content is
translated correctly
 - as soon as I put, for example, "string:${view/_title}", translation
is not done...

I also tried to play with "i18n:" namespace tags, but without success...

Could the fact that "Form.pt / BaseForm.py" and "CurrentForm.py", which
are not in the same package and don't use the same translation domain,
be at the source of my problem ??

Thanks for any help...

  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 : thierry.florac at onf.fr
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85



More information about the Zope3-users mailing list