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

set_state_n(self, value) | source code

Inherited from `base.TranslationUnit`: `__eq__`, `__init__`, `__str__`, `get_state_id`, `get_state_n`, `getcontext`, `getid`, `getunits`, `hasplural`, `infer_state`, `isblank`, `isheader`, `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` Inherited from `base.TranslationUnit` (private): `_get_rich_source`, `_set_rich_source`
Target
Inherited from `base.TranslationUnit`: `gettargetlanguage`, `gettargetlen`, `settarget` Inherited from `base.TranslationUnit` (private): `_get_rich_target`, `_set_rich_target`
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_OBSOLETE = `-100`
| S_UNTRANSLATED = `0`
| S_FUZZY = `30`
| S_TRANSLATED = `100`
| STATE = `{S_OBSOLETE:(state.OBSOLETE, state.EMPTY), S_UNTRANSLA`...`` Default supported states: * obsolete: The unit is not to be used.
Inherited from `base.TranslationUnit`: `S_EMPTY`, `S_FINAL`, `S_NEEDS_REVIEW`, `S_NEEDS_WORK`, `S_REJECTED`, `S_UNREVIEWED`, `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]

### 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)

### set_state_n(self, value)

source code

Overrides: base.TranslationUnit.set_state_n

Class Variable Details | [hide private]

### STATE

    Default supported states:
        * obsolete: The unit is not to be used.
        * empty: The unit has not been translated before.
        * needs work: Some translation has been done, but is not complete.
        * rejected: The unit has been reviewed, but was rejected.
        * needs review: The unit has been translated, but review was requested.
        * unreviewed: The unit has been translated, but not reviewed.
        * final: The unit is translated, reviewed and accepted.

Value:

      {S_OBSOLETE:(state.OBSOLETE, state.EMPTY), S_UNTRANSLATED:(state.EMPTY
      , state.NEEDS_WORK), S_FUZZY:(state.NEEDS_WORK, state.UNREVIEWED), S_T
      RANSLATED:(state.UNREVIEWED, state.MAX),}