| Home | Trees | Index | Help |
|---|
| Package Pootle :: Package storage :: Module api :: Class ITranslationStore |
|
object--+ |Interface--+ |IAnnotatable--+ |object--+ | | |Interface--+ | | |IHaveStatistics--+ |object--+ | | |Interface--+ | | |ISearchable--+ | ITranslationStore
A collection of translation units
This loosely corresponds to a .po file.
Note that the internal container of translation units is not exposed directly so that the implementation can accurately track all changes.
For efficiency reasons modifications are not recorded immediately. Call save() explicitly when you are done modifying the data.| Method Summary | |
|---|---|
Get translation by index (starting from 0). | |
Return a half-open range (by number) of translations. | |
Return an iterable of translation units. | |
__len__(self)
| |
Clear this store and import list of units from given iterable. | |
Construct a new translation unit. | |
Save the current state of this store to persistent storage. | |
Translate the given source message. | |
| Inherited from IHaveStatistics | |
Return statistics for this object. | |
| Inherited from ISearchable | |
Search for a substring in all translation units. | |
| Inherited from object | |
x.__init__(...) initializes x; see x.__class__.__doc__ for signature | |
x.__delattr__('name') <==> del x.name | |
x.__getattribute__('name') <==> x.name | |
x.__hash__() <==> hash(x) | |
T.__new__(S, ...) -> a new object with type S, a subtype of T | |
helper for pickle | |
helper for pickle | |
x.__repr__() <==> repr(x) | |
x.__setattr__('name', value) <==> x.name = value | |
x.__str__() <==> str(x) | |
| Class Variable Summary | |
|---|---|
type |
header = Pootle.storage.api.IHeader |
type |
key = Pootle.storage.api.String |
type |
langinfo = Pootle.storage.api.ILanguageInfo |
type |
module = Pootle.storage.api.IModule |
| Inherited from IAnnotatable | |
NoneType |
annotations = None |
| Method Details |
|---|
__getitem__(self,
number)
Get translation by index (starting from 0).
|
__getslice__(self,
start,
end)
|
__iter__(self)Return an iterable of translation units. |
fill(self, units)Clear this store and import list of units from given iterable. |
makeunit(self, trans)Construct a new translation unit. Only put units constructed by this method inside this store. trans is a list of tuples (source, target). `source` and `target` should be unicode values. Target may be None. |
save(self)Save the current state of this store to persistent storage. |
translate(self, source, plural=0)Translate the given source message. If a plural is requested, its index must be provided. Raises ValueError if source is not found. |
| Home | Trees | Index | Help |
|---|
| Generated by Epydoc 2.1 on Tue Aug 22 04:29:46 2006 | http://epydoc.sf.net |