Ticket #1695: admi18n.patch

File admi18n.patch, 0.9 kB (added by amit, 1 year ago)

I don't know whether this is the correct way to fix the problem, but it works for me...

  • turbogears/toolbox/admi18n/catalog.py

    old new  
    110110 
    111111def normalize(s): 
    112112    # taken from pygettext module but changed a bit 
     113    s = s.strip() 
    113114    lines = s.split('\n') 
    114115    if len(lines) == 1: 
    115116        s = '"' + quote(s) + '"' 
  • turbogears/toolbox/admi18n/pygettext.py

    old new  
    265265def normalize(s, escape=False): 
    266266    # This converts the various Python string types into a format that is 
    267267    # appropriate for .po files, namely much closer to C style. 
     268    s = s.strip() 
    268269    lines = s.split('\n') 
    269270    if len(lines) == 1: 
    270271        s = '"' + escape_unicode(s) + '"'