Roundup Tracker - Issues


Author antmail
Recipients antmail
Date 2015-02-26.16:38:15
Message-id <>
Roundup tracker doesn't support date input in localized notation.
You can't input date such as DD.MM.YYYY.

Patches do the following:
- Add class I18NStaff. 
  Introduce I18NStaff.date_input_re variable which hold locale specific
  regular expression for date parsing.
  Introduce I18NStaff.date_input_desc variable which hold locale specific
  desciption of date/time format.
  Pattern and description can be localized through language translation
  (rebuild roundup's language file: cd locale && gmake template after
  In apropriate language file find:
((?P<y>\d\d\d\d)([/-](?P<m>\d\d?)([/-](?P<d>\d\d?))?)? # yyyy[-mm[-dd]]
|(?P<a>\d\d?)[/-](?P<b>\d\d?))?              # or mm-dd
(?P<n>\.)?                                   # .
(((?P<H>\d?\d):(?P<M>\d\d))?(:(?P<S>\d\d?(\.\d+)?))?)?  # hh:mm:ss
(?P<o>[\d\smywd\-+]+)?                       # offset
  and replace it to desired expression which will parse your country
specific date/time format.
  Regular expression must contain y,m,d group for full date, a,b - for
m-d variant, H,M,S for time
  Also replace 'Proper date/time format is "yyyy-mm-dd",
"yyyy-mm-dd.HH:MM:SS.SSS"' to
  something which describe date/time format.
- combine I18NStaff with RoundupTranslation, RoundupNullTranslation;
 - remove date regular expression variable (date_re) (it in now)
 - set date __init__ default parameter from translator=i18n to
   which is more accurate.
 - remove date_re parameter from Date.set()
 - do use localized translator.date_input_re and
translator.date_input_desc in Date.set()

 - in DateHtmlProperty when _value is a string not converted to date,
plain() and now() throw
   exception because of calling _value.local(). Recently somebody fix it
in plain() 
   ( except AttributeError: ...). Repeat this fix.

 Somebody already do the same thing as i want:
 - hide _error_message.
 - define function add_error_message.
 So, no need to change.
 By the way, there is a some issue. Jinja2 template bundled with
roundup1.5 think that error_msg is a string.
But it is a list. So, _error_msg in page has a bad format. When errors
are localized they become unreadable.

 This is a transit point on the way to hyperdb. The goal is to pass 
 translator object to rawToHyperDB method. So
 - introduce 'translator' variable, which is initialized from 'client'
 - define wrapper function rawToHyperDB which respect translator object;
 - replace direct call hyperdb.rawToHyperDB to wrapper.
 - import translation from i18n for default translator value;
 - add parameter 'translator' to rawToHyperdb function and pass it to
from_raw() method;
 - pass translator to Date object.
Date User Action Args
2015-02-26 16:38:18antmailsetrecipients: + antmail
2015-02-26 16:38:18antmailsetmessageid: <>
2015-02-26 16:38:18antmaillinkissue2550871 messages
2015-02-26 16:38:17antmailcreate