code: def parse_translation(f, lineno):
      
      line = f.readline()
      
      def get_line(f, line, need_keys, lineno, default='""'):
          line = line.rstrip()
          if not line:
              return lineno, need_keys[0], default, line
          key, value = line.split(' ', 1)
          # Parse msgid
          if key not in need_keys:
              print 'Error Line, need %r: %d, line=' % (need_keys, lineno, line)
              raise RuntimeError("parse error")
          v = value
          while 1:
              line = f.readline()
              line = line.rstrip()
              lineno += 1
              if not line or line[0] != '"':
                  break
              v += '\n' + line[:]
          return lineno, key, v, line
      
      # Parse comments
      comments = []
      while 1:
          if not line:
              return lineno, None, None, None
          if line.strip() == '':
              return lineno, comments, None, None
          elif line[0] == '#':
              comments.append(line[:-1])
          else:
              break
          line = f.readline()
          lineno += 1
  
      lineno, key, msgid, line = get_line(f, line, ['msgid'], lineno)
      lineno, key, value, line = get_line(f, line, ['msgid_plural', 'msgstr'], lineno)
      if key == 'msgid_plural':
          msgid = (msgid, value)
          lineno, key, v1, line = get_line(f, line, ['msgstr[0]'], lineno)
          lineno, key, v2, line = get_line(f, line, ['msgstr[1]'], lineno)
          msgstr = (v1, v2)
      else:
          msgstr = value
          
      if line != '':
          print 'File: %s Error Line: %s' % (f.name, line)
          raise RuntimeError("parse error")
  
      return lineno, comments, msgid, msgstr
docs: Read a single translation entry from the file F and return a
      tuple with the comments, msgid and msgstr.  The comments is returned
      as a list of lines which do not end in new-lines.  The msgid and
      msgstr are strings, possibly with embedded newlines