web/formwidgets.py
changeset 6737 de49060d4be3
parent 6682 bdf9424b499c
child 6882 b5e34836f84e
equal deleted inserted replaced
6736:36ed2bf7ad3d 6737:de49060d4be3
   565         super(JQueryDatePicker, self).__init__(**kwargs)
   565         super(JQueryDatePicker, self).__init__(**kwargs)
   566         self.datestr = datestr
   566         self.datestr = datestr
   567 
   567 
   568     def _render(self, form, field, renderer):
   568     def _render(self, form, field, renderer):
   569         req = form._cw
   569         req = form._cw
       
   570         if req.lang != 'en':
       
   571             req.add_js('jquery.ui.datepicker-%s.js' % req.lang)
   570         domid = field.dom_id(form, self.suffix)
   572         domid = field.dom_id(form, self.suffix)
   571         # XXX find a way to understand every format
   573         # XXX find a way to understand every format
   572         fmt = req.property_value('ui.date-format')
   574         fmt = req.property_value('ui.date-format')
   573         fmt = fmt.replace('%Y', 'yy').replace('%m', 'mm').replace('%d', 'dd')
   575         fmt = fmt.replace('%Y', 'yy').replace('%m', 'mm').replace('%d', 'dd')
   574         req.add_onload(u'cw.jqNode("%s").datepicker('
   576         req.add_onload(u'cw.jqNode("%s").datepicker('