home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Linux / Linux Mint 3.0 Light / LinuxMint-3.0-Light.iso / casper / filesystem.squashfs / usr / share / xml2po / ubuntu.py < prev    next >
Encoding:
Python Source  |  2007-04-09  |  874 b   |  26 lines

  1. # Copyright (c) 2006 Danilo Segan <danilo@kvota.net>.
  2.  
  3. import libxml2
  4.  
  5. from docbook import docbookXmlMode
  6.  
  7. class ubuntuXmlMode (docbookXmlMode):
  8.     """Special-casing Ubuntu DocBook website documentation."""
  9.     def postProcessXmlTranslation(self, doc, language, translators):
  10.         """Sets a language and translators in "doc" tree."""
  11.  
  12.         # Call ancestor method
  13.         docbookXmlMode.postProcessXmlTranslation(self, doc, language, translators)
  14.  
  15.         try:
  16.             child = doc.docEntity('language')
  17.             newent = doc.addDocEntity('my_internal_hacky_language_entity_decl', libxml2.XML_INTERNAL_GENERAL_ENTITY, None, None, language)
  18.             newent.setName('language')
  19.             child.replaceNode(newent)
  20.         except:
  21.             newent = doc.addDocEntity('language', libxml2.XML_INTERNAL_GENERAL_ENTITY, None, None, language)
  22.  
  23.         
  24.  
  25.         
  26.