Package translate :: Package storage :: Module subtitles :: Class SubtitleUnit
[hide private]
[frames] | no frames]

Class SubtitleUnit

source code


A subtitle entry that is translatable

Instance Methods [hide private]
 
__init__(self, source=None, encoding="utf_8")
Constructs a TranslationUnit containing the given source string.
source code
string
getid(self)
A unique identifier for this unit.
source code

Inherited from base.TranslationUnit: __eq__, __str__, getcontext, getunits, hasplural, isblank, isfuzzy, isheader, isobsolete, isreview, istranslatable, istranslated, makeobsolete, markfuzzy, markreviewneeded, merge, multistring_to_rich, setcontext, setid, unit_iter

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

    Source

Inherited from base.TranslationUnit: getsourcelanguage, setsource

    Target

Inherited from base.TranslationUnit: gettargetlanguage, gettargetlen, settarget

    Notes
 
getnotes(self, origin=None)
Returns all notes about this unit.
source code

Inherited from base.TranslationUnit: addnote, removenotes

    Locations
List
getlocations(self)
A list of source code locations.
source code

Inherited from base.TranslationUnit: addlocation, addlocations

    Errors

Inherited from base.TranslationUnit: adderror, geterrors

Class Methods [hide private]

Inherited from base.TranslationUnit: buildfromunit, rich_to_multistring

Class Variables [hide private]

Inherited from base.TranslationUnit: rich_parsers

Properties [hide private]

Inherited from base.TranslationUnit: rid, xid

Inherited from object: __class__

    Source

Inherited from base.TranslationUnit: rich_source, source

    Target

Inherited from base.TranslationUnit: rich_target, target

Method Details [hide private]

__init__(self, source=None, encoding="utf_8")
(Constructor)

source code 

Constructs a TranslationUnit containing the given source string.

Overrides: object.__init__
(inherited documentation)

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)

getlocations(self)

source code 

A list of source code locations.

Returns: List
Overrides: base.TranslationUnit.getlocations
(inherited documentation)

getid(self)

source code 

A unique identifier for this unit.

Returns: string
an identifier for this unit that is unique in the store

Derived classes should override this in a way that guarantees a unique identifier for each unit in the store.

Overrides: base.TranslationUnit.getid
(inherited documentation)