Package translate :: Package storage :: Module qph :: Class QphUnit

[hide private]
[frames] | no frames]

# Class QphUnit

source code

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

A single term in the qph file.

Instance Methods | [hide private]

createlanguageNode(self, lang, text, purpose) Returns an xml Element setup with given parameters. | source code

getlanguageNodes(self) We override this to get source and target nodes. | source code

string

getid(self) A unique identifier for this unit. | source code

merge(self, otherunit, overwrite=False, comments=True) Do basic format agnostic merging. | source code

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

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

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

Source

_getsourcenode(self) | source code

Inherited from `lisa.LISAunit`: `getsource`, `setsource` Inherited from `base.TranslationUnit`: `getsourcelanguage`
Target

_gettargetnode(self) | source code

settarget(self, text) Sets the "target" string (second language), or alternatively appends to the list | source code

gettarget(self) retrieves the "target" text (second entry), or the entry in the specified language, if it exists | source code

Inherited from `base.TranslationUnit`: `gettargetlanguage`, `gettargetlen`
Notes

addnote(self, text, origin=None) Add a note specifically in a "definition" tag | 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
Inherited from `base.TranslationUnit`: `adderror`, `geterrors`

Class Methods | [hide private]

Inherited from `lisa.LISAunit`: `createfromxmlElement` Inherited from `base.TranslationUnit`: `buildfromunit`

Class Variables | [hide private]

| rootNode = ``'``phrase``'``
| languageNode = ``'``source``'``
| textNode = `""`
| namespace = ``'````'``

Properties | [hide private]

Inherited from `object`: `__class__`
Source
Inherited from `lisa.LISAunit`: `source`
Target
| target retrieves the "target" text (second entry), or the entry in the specified language, if it exists

Method Details | [hide private]

### createlanguageNode(self, lang, text, purpose)

source code

Returns an xml Element setup with given parameters.

Overrides: lisa.LISAunit.createlanguageNode

### getlanguageNodes(self)

source code

We override this to get source and target nodes.

Overrides: lisa.LISAunit.getlanguageNodes

### settarget(self, text)

source code

Sets the "target" string (second language), or alternatively appends to the list

Overrides: base.TranslationUnit.settarget
  (inherited documentation)

### gettarget(self)

source code

retrieves the "target" text (second entry), or the entry in the specified language, if it exists

Overrides: lisa.LISAunit.gettarget
  (inherited documentation)

### addnote(self, text, origin=None)

source code

Add a note specifically in a "definition" tag

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

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

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

### merge(self, otherunit, overwrite=False, comments=True)

source code

Do basic format agnostic merging.

Overrides: base.TranslationUnit.merge
  (inherited documentation)

Property Details | [hide private]

### target

retrieves the "target" text (second entry), or the entry in the specified language, if it exists

Get Method:
  gettarget(self) - retrieves the "target" text (second entry), or the entry in the specified language, if it exists
Set Method:
  settarget(self, text) - Sets the "target" string (second language), or alternatively appends to the list