Package translate :: Package storage :: Module pocommon :: Class pounit
[hide private]
[frames] | no frames]

Class pounit

source code


Instance Methods [hide private]
 
markreviewneeded(self, needsreview=True, explanation=None)
Marks the unit to indicate whether it needs review.
source code
 
istranslated(self)
Indicates whether this unit is translated.
source code
 
istranslatable(self)
Indicates whether this unit can be translated.
source code
 
hasmarkedcomment(self, commentmarker) source code
 
isreview(self)
Indicates whether this unit needs review.
source code
 
isobsolete(self)
indicate whether a unit is obsolete
source code
 
isfuzzy(self)
Indicates whether this unit is fuzzy.
source code
 
markfuzzy(self, present=True)
Marks the unit as fuzzy or not.
source code
 
makeobsolete(self)
Make a unit obsolete
source code
 
resurrect(self) source code
 
_domarkfuzzy(self, present=True) source code
 
get_state_n(self) source code
 
set_state_n(self, value) source code

Inherited from base.TranslationUnit: __eq__, __init__, __str__, get_state_id, getcontext, getid, getunits, hasplural, infer_state, isblank, isheader, merge, multistring_to_rich, setcontext, setid, unit_iter

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

    Source

Inherited from base.TranslationUnit: getsourcelanguage, setsource

    Target

Inherited from base.TranslationUnit: gettargetlanguage, gettargetlen, settarget

    Notes

Inherited from base.TranslationUnit: addnote, getnotes, removenotes

    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 base.TranslationUnit: buildfromunit, rich_to_multistring

Class Variables [hide private]
  S_FUZZY_OBSOLETE = state.OBSOLETE-1
  S_OBSOLETE = -100
  S_UNTRANSLATED = 0
  S_FUZZY = 30
  S_TRANSLATED = 100
  STATE = {S_FUZZY_OBSOLETE:(S_FUZZY_OBSOLETE, state.OBSOLETE), ...

Inherited from base.TranslationUnit: S_EMPTY, S_FINAL, S_NEEDS_REVIEW, S_NEEDS_WORK, S_REJECTED, S_UNREVIEWED, rich_parsers

Inherited from base.TranslationUnit (private): _state_n, _store

    Source

Inherited from base.TranslationUnit (private): _rich_source, _source

    Target

Inherited from base.TranslationUnit (private): _rich_target, _target

    Notes

Inherited from base.TranslationUnit: notes

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]

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

markreviewneeded(self, needsreview=True, explanation=None)

source code 

Marks the unit to indicate whether it needs review. Adds an optional explanation as a note.

Parameters:
  • needsreview - Defaults to True.
  • explanation - Adds an optional explanation as a note.
Overrides: base.TranslationUnit.markreviewneeded

istranslated(self)

source code 

Indicates whether this unit is translated.

This should be used rather than deducing it from .target, to ensure that other classes can implement more functionality (as XLIFF does).

Overrides: base.TranslationUnit.istranslated
(inherited documentation)

istranslatable(self)

source code 

Indicates whether this unit can be translated.

This should be used to distinguish real units for translation from header, obsolete, binary or other blank units.

Overrides: base.TranslationUnit.istranslatable
(inherited documentation)

isreview(self)

source code 

Indicates whether this unit needs review.

Overrides: base.TranslationUnit.isreview
(inherited documentation)

isobsolete(self)

source code 

indicate whether a unit is obsolete

Overrides: base.TranslationUnit.isobsolete
(inherited documentation)

isfuzzy(self)

source code 

Indicates whether this unit is fuzzy.

Overrides: base.TranslationUnit.isfuzzy
(inherited documentation)

markfuzzy(self, present=True)

source code 

Marks the unit as fuzzy or not.

Overrides: base.TranslationUnit.markfuzzy
(inherited documentation)

makeobsolete(self)

source code 

Make a unit obsolete

Overrides: base.TranslationUnit.makeobsolete
(inherited documentation)

get_state_n(self)

source code 
Overrides: base.TranslationUnit.get_state_n

set_state_n(self, value)

source code 
Overrides: base.TranslationUnit.set_state_n

Class Variable Details [hide private]

STATE

Value:
{S_FUZZY_OBSOLETE:(S_FUZZY_OBSOLETE, state.OBSOLETE), S_OBSOLETE:(stat\
e.OBSOLETE, state.EMPTY), S_UNTRANSLATED:(state.EMPTY, state.NEEDS_WOR\
K), S_FUZZY:(state.NEEDS_WORK, state.UNREVIEWED), S_TRANSLATED:(state.\
UNREVIEWED, state.MAX),}