How to use ILanguageIndependentField on a field using a widget?

I'm trying to customize the behaviour of the Event type. I need to make some fields language independent.

I added this to the

from zope.interface import alsoProvides
from import ILanguageIndependentField
from import IEventBasic
from import IEventContact
from import IEventAttendees
from import IEventRecurrence
from import ILeadImage

alsoProvides(IEventBasic['start'], ILanguageIndependentField)
alsoProvides(IEventBasic['whole_day'], ILanguageIndependentField)
alsoProvides(IEventBasic['open_end'], ILanguageIndependentField)
alsoProvides(IEventContact['contact_name'], ILanguageIndependentField)
alsoProvides(IEventContact['contact_email'], ILanguageIndependentField)
alsoProvides(IEventContact['contact_phone'], ILanguageIndependentField)
alsoProvides(IEventAttendees['attendees'], ILanguageIndependentField)
alsoProvides(IEventRecurrence['recurrence'], ILanguageIndependentField)
alsoProvides(ILeadImage['image'], ILanguageIndependentField)

On a text field like IEventContact['contact_name'] it works just fine however on IEventBasic['start'] it doesn't. The difference is that this field is defined as a widget in the behavior.

@adapter(getSpecification(IEventBasic['start']), IPloneFormLayer)
def StartDateFieldWidget(field, request):
    widget = FieldWidget(field, DatetimeWidget(request))
    widget.default_timezone = default_timezone
    return widget

Anyone knows how to fix it?


I guess you read this?

There are quite a few people who use p.a.multilingual who should be able to help you.

We just added languageindependent fields to IEventBasis as the default

1 Like