Changeset 5367

Show
Ignore:
Timestamp:
09/07/08 17:17:44 (3 months ago)
Author:
carndt
Message:

Fix #1695 - now stripping whitespace around kid text elements when doing i18n message collection from kid files

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.0/turbogears/command/i18n.py

    r4740 r5367  
    327327            s = _py_i18n_re.search(k) 
    328328            if s: 
    329                 key = s.group(1) or s.group(2
     329                key = (s.group(1) or s.group(2) or '').strip(
    330330            elif not is_attribute: 
    331331                # we don't have a kid expression in there, so it is 
     
    336336                    print "Warning: Mixed content in tag <%s>: %s" % (tag, k) 
    337337                elif isinstance(parts, basestring): 
    338                     key = k 
     338                    key = k.strip() 
    339339            if key and (key not in keys) and (tag not in tags_to_ignore): 
    340340                messages.append((tag, fname, key)) 
  • branches/1.1/turbogears/command/i18n.py

    r4740 r5367  
    331331            s = _py_i18n_re.search(k) 
    332332            if s: 
    333                 key = s.group(1) or s.group(2
     333                key = (s.group(1) or s.group(2) or '').strip(
    334334            elif not is_attribute: 
    335335                # we don't have a kid expression in there, so it is 
     
    340340                    print "Warning: Mixed content in tag <%s>: %s" % (tag, k) 
    341341                elif isinstance(parts, basestring): 
    342                     key = k 
     342                    key = k.strip() 
    343343            if key and (key not in keys) and (tag not in tags_to_ignore): 
    344344                messages.append((tag, fname, key)) 
  • branches/1.5/turbogears/command/i18n.py

    r4963 r5367  
    331331            s = _py_i18n_re.search(k) 
    332332            if s: 
    333                 key = s.group(1) or s.group(2
     333                key = (s.group(1) or s.group(2) or '').strip(
    334334            elif not is_attribute: 
    335335                # we don't have a kid expression in there, so it is 
     
    340340                    print "Warning: Mixed content in tag <%s>: %s" % (tag, k) 
    341341                elif isinstance(parts, basestring): 
    342                     key = k 
     342                    key = k.strip() 
    343343            if key and (key not in keys) and (tag not in tags_to_ignore): 
    344344                messages.append((tag, fname, key))