Package translate :: Package storage :: Module jsonl10n :: Class JsonUnit
[hide private]
[frames] | no frames]

Class JsonUnit

source code


A JSON entry

Instance Methods [hide private]
 
__init__(self, source=None, ref=None, item=None, encoding='UTF-8')
Constructs a TranslationUnit containing the given source string.
source code
 
setid(self, value)
Sets the unique identified for this unit.
source code
string
getid(self)
A unique identifier for this unit.
source code

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

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

    Source
 
getsource(self) source code
 
setsource(self, source)
Sets the source string to the given value.
source code

Inherited from base.TranslationUnit: getsourcelanguage

    Target
 
gettarget(self) source code
 
settarget(self, target)
Sets the target string to the given value.
source code

Inherited from base.TranslationUnit: gettargetlanguage, gettargetlen

    Notes

Inherited from base.TranslationUnit: addnote, getnotes, 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: STATE, S_EMPTY, S_FINAL, S_NEEDS_REVIEW, S_NEEDS_WORK, S_OBSOLETE, S_REJECTED, S_UNREVIEWED, rich_parsers

Properties [hide private]

Inherited from base.TranslationUnit: rid, xid

Inherited from object: __class__

    Source
  source

Inherited from base.TranslationUnit: rich_source

    Target
  target

Inherited from base.TranslationUnit: rich_target

Method Details [hide private]

__init__(self, source=None, ref=None, item=None, encoding='UTF-8')
(Constructor)

source code 

Constructs a TranslationUnit containing the given source string.

Overrides: object.__init__
(inherited documentation)

setsource(self, source)

source code 

Sets the source string to the given value.

Overrides: base.TranslationUnit.setsource
(inherited documentation)

settarget(self, target)

source code 

Sets the target string to the given value.

Overrides: base.TranslationUnit.settarget
(inherited documentation)

setid(self, value)

source code 

Sets the unique identified for this unit.

only implemented if format allows ids independant from other unit properties like source or context

Overrides: base.TranslationUnit.setid
(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)

getlocations(self)

source code 

A list of source code locations.

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

Property Details [hide private]

source

Get Method:
getsource(self)
Set Method:
setsource(self, source) - Sets the source string to the given value.

target

Get Method:
gettarget(self)
Set Method:
settarget(self, target) - Sets the target string to the given value.