Package translate :: Package storage :: Module csvl10n :: Class csvunit

[hide private]
[frames] | no frames]

# Class csvunit

source code

              object --+
                       |
    base.TranslationUnit --+
                           |
                          csvunit

Base class for translation units.

Our concept of a translation unit is influenced heavily by XLIFF: http://www.oasis-open.org/committees/xliff/documents/xliff-specification.htm

As such most of the method- and variable names borrows from XLIFF terminology.

A translation unit consists of the following:

- A source string. This is the original translatable text.
- A target string. This is the translation of the source.
- Zero or more notes on the unit. Notes would typically be some comments from a translator on the unit, or some comments originating from the source code.
- Zero or more locations. Locations indicate where in the original source code this unit came from.
- Zero or more errors. Some tools (eg. pofilter) can run checks on translations and produce error messages.

Instance Methods | [hide private]

__init__(self, source=None) Constructs a TranslationUnit containing the given source string. | source code

add_spreadsheet_escapes(self, source, target) add common spreadsheet escapes to two strings | source code

remove_spreadsheet_escapes(self, source, target) remove common spreadsheet escapes from two strings | source code

fromdict(self, cedict) | source code

todict(self, encoding=`'``utf-8``'`) | source code

Inherited from `base.TranslationUnit`: `__eq__`, `getcontext`, `getid`, `getunits`, `hasplural`, `isblank`, `isfuzzy`, `isheader`, `isreview`, `istranslatable`, `istranslated`, `markfuzzy`, `markreviewneeded`, `merge`, `unit_iter` Inherited from `object`: `__delattr__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__repr__`, `__setattr__`, `__str__`
Source
Inherited from `base.TranslationUnit`: `getsourcelanguage`
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
Inherited from `base.TranslationUnit`: `adderror`, `geterrors`

Class Methods | [hide private]

Inherited from `base.TranslationUnit`: `buildfromunit`

Class Variables | [hide private]

| spreadsheetescapes = ``[``(``'``+``'``,` `'``\\+``'``)``,` `(``'``-``'``,` `'``\\-``'``)``,` `(``'``=``'``,` `'``\\=``'``)``...``

Properties | [hide private]

Inherited from `object`: `__class__`

Method Details | [hide private]

### __init__(self, source=None)
(Constructor)

source code

Constructs a TranslationUnit containing the given source string.

Overrides: object.__init__
  (inherited documentation)

Class Variable Details | [hide private]

### spreadsheetescapes

Value:

      [('+', '\\+'), ('-', '\\-'), ('=', '\\='), ('\'', '\\\'')]