parameters: (self, lang, pseudo_if_not_available=True,
                  skeleton_gatherer=None, fallback_to_english=False)
return_statement: return ''.join(out)
docstring: Returns this document with translateable messages filled with
      the translation for language 'lang'.
  
      Args:
        lang: 'en'
        pseudo_if_not_available: True
  
      Return:
        'ID_THIS_SECTION TYPE\n...BEGIN\n  "Translated message"\n......\nEND
  
      Raises:
        grit.exception.NotReady() if used before Parse() has been successfully
        called.
        grit.exception.NoSuchTranslation() if 'pseudo_if_not_available' is false
        and there is no translation for the requested language.
docstring_summary: Returns this document with translateable messages filled with
      the translation for language 'lang'.
docstring_tokens: Returns this document with translateable messages filled with the translation for language lang .
function: def Translate(self, lang, pseudo_if_not_available=True,
                  skeleton_gatherer=None, fallback_to_english=False):
      '''Returns this document with translateable messages filled with
      the translation for language 'lang'.
  
      Args:
        lang: 'en'
        pseudo_if_not_available: True
  
      Return:
        'ID_THIS_SECTION TYPE\n...BEGIN\n  "Translated message"\n......\nEND
  
      Raises:
        grit.exception.NotReady() if used before Parse() has been successfully
        called.
        grit.exception.NoSuchTranslation() if 'pseudo_if_not_available' is false
        and there is no translation for the requested language.
      '''
      if len(self.skeleton_) == 0:
        raise exception.NotReady()
  
      # TODO(joi) Implement support for skeleton gatherers here.
  
      out = []
      for item in self.skeleton_:
        if isinstance(item, types.StringTypes):
          out.append(item)
        else:
          msg = item.MessageForLanguage(lang,
                                        pseudo_if_not_available,
                                        fallback_to_english)
          for content in msg.GetContent():
            if isinstance(content, tclib.Placeholder):
              out.append(content.GetOriginal())
            else:
              # We escape " characters to increase the chance that attributes
              # will be properly escaped.
              out.append(util.EscapeHtml(content, True))
  
      return ''.join(out)
function_tokens: def Translate ( self , lang , pseudo_if_not_available = True , skeleton_gatherer = None , fallback_to_english = False ) : if len ( self . skeleton_ ) == 0 : raise exception . NotReady ( ) # TODO(joi) Implement support for skeleton gatherers here. out = [ ] for item in self . skeleton_ : if isinstance ( item , types . StringTypes ) : out . append ( item ) else : msg = item . MessageForLanguage ( lang , pseudo_if_not_available , fallback_to_english ) for content in msg . GetContent ( ) : if isinstance ( content , tclib . Placeholder ) : out . append ( content . GetOriginal ( ) ) else : # We escape " characters to increase the chance that attributes # will be properly escaped. out . append ( util . EscapeHtml ( content , True ) ) return '' . join ( out )