I got past my previous issue by removing some extra files in the locales
directory (I'm still checking with the committer to see if that is ok). Now
I've run into another localization issue around date formating and forms.
When I submit the form adding my discount to a payable item I get an
attribute error looking up self.request.locale. For some reason the
HTTPRequest does not have a local associated with it. The code that fails
is:
parts/zope2/lib/python/zope/formlib/form.py(809)handle_edit_action()
805 @action(_("Apply"), condition=haveInputWidgets)
806 def handle_edit_action(self, action, data):
807 if applyChanges(self.context, self.form_fields, data,
self.adapters):
808 zope.event.notify(ObjectModifiedEvent(self.context))
809 -> formatter = self.request.locale.dates.getFormatter(
810 'dateTime', 'medium')
811
812 try:
813 time_zone = idatetime.ITZInfo(self.request)
814 except TypeError:
I can get my own locale object like this while in the pdb session:
from Acquisition import aq_inner
from zope.component import getMultiAdapter
context = aq_inner(self.context)
portal_state = getMultiAdapter((context, self.request),
name=u'plone_portal_state')
current_locale = portal_state.locale()
but I'm guessing I shouldn't modify formlib. I'm also curious why my
request doesn't have a local associated with it. I've run this both in
chrome and firefox on os x, firefox sends HTTP_ACCEPT_LANGUAGE in the
headers, chrome does not, but it does send en-US in the user agent. Any
thoughts or suggestions on where else I should look? Thanks.
-Rob
--
GetPaid for Plone: http://www.plonegetpaid.com (overview info) |
http://code.google.com/p/getpaid (code and issue tracker)
You received this message because you are subscribed to the Google Groups
"getpaid-dev" 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/getpaid-dev?hl=en?hl=en