Package translate :: Package storage :: Module tmx :: Class tmxunit
[hide private]
[frames] | no frames]

Class tmxunit

source code

          object --+        
                   |        
base.TranslationUnit --+    
                       |    
           lisa.LISAunit --+
                           |
                          tmxunit

A single unit in the TMX file.

Instance Methods [hide private]
 
createlanguageNode(self, lang, text, purpose)
returns a langset xml Element setup with given parameters
source code

Inherited from lisa.LISAunit: __eq__, __init__, __str__, createPHnodes, getNodeText, getlanguageNode, getlanguageNodes, namespaced

Inherited from base.TranslationUnit: getcontext, getid, getunits, hasplural, isblank, isfuzzy, isheader, isreview, istranslatable, istranslated, markfuzzy, markreviewneeded, merge, unit_iter

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__

    Source

Inherited from lisa.LISAunit: getsource, setsource

    Target

Inherited from lisa.LISAunit: gettarget, settarget

Inherited from base.TranslationUnit: gettargetlen

    Notes
 
addnote(self, text, origin=None)
Add a note specifically in a "note" tag.
source code
 
getnotelist(self, origin=None)
Private method that returns the text from notes.
source code
 
getnotes(self, origin=None)
Returns all notes about this unit.
source code
 
removenotes(self)
Remove all the translator notes.
source code
    Locations

Inherited from base.TranslationUnit: addlocation, addlocations, getlocations

    Errors
 
adderror(self, errorname, errortext)
Adds an error message to this unit.
source code
Dictionary
geterrors(self)
Get all error messages.
source code
Class Methods [hide private]

Inherited from lisa.LISAunit: createfromxmlElement

Inherited from base.TranslationUnit: buildfromunit

Class Variables [hide private]
  rootNode = 'tu'
  languageNode = 'tuv'
  textNode = 'seg'

Inherited from lisa.LISAunit: namespace

Properties [hide private]

Inherited from object: __class__

    Source

Inherited from lisa.LISAunit: source

    Target

Inherited from lisa.LISAunit: target

Method Details [hide private]

createlanguageNode(self, lang, text, purpose)

source code 

returns a langset xml Element setup with given parameters

Overrides: lisa.LISAunit.createlanguageNode

addnote(self, text, origin=None)

source code 

Add a note specifically in a "note" tag.

The origin parameter is ignored

Parameters:
  • text - Usually just a sentence or two.
  • origin - Specifies who/where the comment comes from. Origin can be one of the following text strings:
    • 'translator'
    • 'developer', 'programmer', 'source code' (synonyms)
Overrides: base.TranslationUnit.addnote

getnotelist(self, origin=None)

source code 

Private method that returns the text from notes.

The origin parameter is ignored..

getnotes(self, origin=None)

source code 

Returns all notes about this unit.

It will probably be freeform text or something reasonable that can be synthesised by the format. It should not include location comments (see getlocations()).

Overrides: base.TranslationUnit.getnotes
(inherited documentation)

removenotes(self)

source code 

Remove all the translator notes.

Overrides: base.TranslationUnit.removenotes

adderror(self, errorname, errortext)

source code 

Adds an error message to this unit.

Parameters:
  • errorname - A single word to id the error.
  • errortext - The text describing the error.
Overrides: base.TranslationUnit.adderror

geterrors(self)

source code 

Get all error messages.

Returns: Dictionary
Overrides: base.TranslationUnit.geterrors