I have an annoying i18n translation issue in a otherwise perfectly
behaved setup.
The "Add ${subitem_title}" link in a SequenceWidget isn't properly
translate when switching languages. Only the "Add " is translated, but
the ${subitem_title} isn't.
This is weird, because ${subitem_title} defaults to the title of the
sequence item and I defined that as usual, like this:
TimeslotSchema(title=_(u'timeslot'))
But no matter what language I choose, this part stubbornly refuses to
change while other Schema 'title' attributes switch just fine.
Even more annoying; the legend of the fieldset does change correctly!
So the problem is located somewhere in the "Add" link.
The relevant bits of my i18n setup is as follows:
# config snippet
from pkg_resources import resource_filename
from pyramid.config import translator
config.add_translation_dirs('colander:locale/', 'deform:locale/',
'myproject:locale/')
deform.field.Field.set_zpt_renderer((resource_filename('myproject',
'templates/'), deform.template.default_dir,), translator=translator)
# form snippet
class TimeslotSequenceSchema(colander.SequenceSchema):
timeslot = TimeslotSchema(title=_(u'timeslot'))
class TimeslotsSchema(colander.MappingSchema):
timeslots = TimeslotSequenceSchema(title=_(u'timeslots'),
widget=SequenceWidget(css_class='timeslots'))
Any help is much appreciated.
Kind regards,
Keesjan
--
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/pylons-discuss?hl=en.