parameters: (xtb_file, callback_function, defs=None, debug=False,
            target_platform=None)
return_statement: return handler.language
docstring: Parse xtb_file, making a call to callback_function for every translation
    in the XTB file.
  
    The callback function must have the signature as described below.  The 'parts'
    parameter is a list of tuples (is_placeholder, text).  The 'text' part is
    either the raw text (if is_placeholder is False) or the name of the placeholder
    (if is_placeholder is True).
  
    Args:
      xtb_file:           open('fr.xtb', 'rb')
      callback_function:  def Callback(msg_id, parts): pass
      defs:               None, or a dictionary of preprocessor definitions.
      debug:              Default False. Set True for verbose debug output.
      target_platform:    None, or a sys.platform-like identifier of the build
                          target platform.
  
    Return:
      The language of the XTB, e.g. 'fr'
docstring_summary: Parse xtb_file, making a call to callback_function for every translation
    in the XTB file.
docstring_tokens: Parse xtb_file making a call to callback_function for every translation in the XTB file .
function: def Parse(xtb_file, callback_function, defs=None, debug=False,
            target_platform=None):
    '''Parse xtb_file, making a call to callback_function for every translation
    in the XTB file.
  
    The callback function must have the signature as described below.  The 'parts'
    parameter is a list of tuples (is_placeholder, text).  The 'text' part is
    either the raw text (if is_placeholder is False) or the name of the placeholder
    (if is_placeholder is True).
  
    Args:
      xtb_file:           open('fr.xtb', 'rb')
      callback_function:  def Callback(msg_id, parts): pass
      defs:               None, or a dictionary of preprocessor definitions.
      debug:              Default False. Set True for verbose debug output.
      target_platform:    None, or a sys.platform-like identifier of the build
                          target platform.
  
    Return:
      The language of the XTB, e.g. 'fr'
    '''
    # Start by advancing the file pointer past the DOCTYPE thing, as the TC
    # uses a path to the DTD that only works in Unix.
    # TODO(joi) Remove this ugly hack by getting the TC gang to change the
    # XTB files somehow?
    front_of_file = xtb_file.read(1024)
    xtb_file.seek(front_of_file.find(b'<translationbundle'))
  
    handler = XtbContentHandler(callback=callback_function, defs=defs,
                                debug=debug, target_platform=target_platform)
    xml.sax.parse(xtb_file, handler)
    assert handler.language != ''
    return handler.language
function_tokens: def Parse ( xtb_file , callback_function , defs = None , debug = False , target_platform = None ) : # Start by advancing the file pointer past the DOCTYPE thing, as the TC # uses a path to the DTD that only works in Unix. # TODO(joi) Remove this ugly hack by getting the TC gang to change the # XTB files somehow? front_of_file = xtb_file . read ( 1024 ) xtb_file . seek ( front_of_file . find ( b'<translationbundle' ) ) handler = XtbContentHandler ( callback = callback_function , defs = defs , debug = debug , target_platform = target_platform ) xml . sax . parse ( xtb_file , handler ) assert handler . language != '' return handler . language