Part of lp.translations.interfaces.webservice View In Hierarchy
Known subclasses: lp.translations.browser.potemplate.IPOTemplateEditForm
Text | header | The standard template header in its native format. |
Choice | productseries | Undocumented |
Choice | distroseries | Undocumented |
Choice | sourcepackagename | The source package that uses this template. |
Int | sourcepackagenameID | The ID of the source package that uses this template. |
Choice | from_sourcepackagename | The source package this template comes from (set it only if it's different from the previous 'Source Package Name'. |
TextLine | sourcepackageversion | Undocumented |
Object | source_file | Undocumented |
Datetime | datecreated | Undocumented |
Attribute | translationgroups | The ITranslationGroup objects that handle translations for this |
Choice | translationpermission | The permission system which is used for this translation template. |
Attribute | relatives_by_source | All IPOTemplate objects that have the same source. |
TextLine | displayname | Undocumented |
TextLine | title | Undocumented |
Object | product | Undocumented |
Object | distribution | Undocumented |
Attribute | translationtarget | The direct object in which this template is attached. |
Bool | uses_english_msgids | Some formats, such as Mozilla's XPI, use symbolic msgids where |
Int | translation_side | Undocumented |
Method | __iter__ | Return an iterator over current IPOTMsgSet in this template. |
Method | clearPOFileCache | Clear POFile -related cached data. |
Method | setActive | Toggle the iscurrent flag. |
Method | getHeader | Return an ITranslationHeaderData representing its header. |
Method | getPOTMsgSetByMsgIDText | Return IPOTMsgSet indexed by singular_text from this template. |
Method | getPOTMsgSetBySequence | Return the IPOTMsgSet with the given sequence or None. |
Method | getPOTMsgSets | Return an iterator over IPOTMsgSet objects in this template. |
Method | getTranslationCredits | Return an iterator over translation credits. |
Method | getPOTMsgSetsCount | Return the number of POTMsgSet objects related to this object. |
Method | __getitem__ | Same as getPOTMsgSetByMsgIDText(), with only_current=True |
Method | sharingKey | A key for determining the sharing precedence of a template. |
Method | getPOTMsgSetByID | Return the POTMsgSet object related to this POTemplate with the id. |
Method | languages | This Return the set of languages for which we have POFiles for |
Method | getPOFileByPath | Get the PO file of the given path. |
Method | getPOFileByLang | Get the PO file of the given language. |
Method | getOtherSidePOTemplate | Get the POTemplate with the same name on the other side of a |
Method | hasPluralMessage | Test whether this template has any message sets which are plural |
Method | export | Return a serialized version as a string using its native format. |
Method | exportWithTranslations | Return an ExportedTranslationFile using its native format. |
Method | expireAllMessages | Mark all of our message sets as not current (sequence=0) |
Method | newPOFile | Return a new IPOFile for the given language. |
Method | getDummyPOFile | Return a DummyPOFile if there isn't already a persistent IPOFile |
Method | createPOTMsgSetFromMsgIDs | Creates a new template message in the database. |
Method | createMessageSetFromText | Creates a new template message in the database using strings. |
Method | getOrCreateSharedPOTMsgSet | Finds an existing shared POTMsgSet to use or creates a new one. |
Method | importFromQueue | Import given queue entry. |
Method | getTranslationRows | Return the IVPOTexport objects for this template. |
Method | awardKarma | Award karma for a translation action on this template. |
Method | getTranslationPolicy | Return the applicable ITranslationPolicy object. |
Inherited from IRosettaStats:
Method | testStatistics | Ensure that the statistics here are self-consistent. |
Method | updateStatistics | Update the statistics associated with this object. |
Method | messageCount | Return the number of current IPOMessageSets inside this object. |
Method | currentCount | Return the number of current upstream translations. |
Method | updatesCount | Return the number of msgsets newer in Rosetta. |
Method | newCount | Return the number of newly translated messages in Rosetta. |
Method | rosettaCount | Return the number of msgsets translated only in rosetta. |
Method | unreviewedCount | Return the number of msgsets with unreviewed suggestions. |
Method | translatedCount | Return the total number of msgsets that are translated in Rosetta. |
Method | untranslatedCount | Return the number of msgsets that are untranslated. |
Method | updatesPercentage | Return the percentage of updated msgsets inside this object. |
Method | currentPercentage | Return the percentage of current msgsets inside this object. |
Method | rosettaPercentage | Return the percentage of msgsets translated with Rosetta inside |
Method | translatedPercentage | Return the percentage of msgsets translated for this object. |
Method | untranslatedPercentage | Return the percentage of msgsets untranslated for this object. |
Method | newPercentage | Return the percentage of translations for this object that are |
ITranslationGroup
objects that handle translations for this
template.
There can be several because they can be inherited from project to
product, for example.IPOTemplate
objects that have the same source.
For example those that came from the same productseries or the
same source package.ISourcePackage
or an IProductSeries
.POFile
-related cached data.
As you work with a POTemplate
, some data about its POFile`s
gets cached. But if you're iterating over the template's
translations one `POFile
at a time, you can drop any cached
data about a POFile
as soon as you're done with it. Use this
method to do that.
Takes care of updating the suggestive potempalte cache when the template is disabled.
IPOTMsgSet
indexed by singular_text
from this template.
If the key is a string or a unicode object, returns the
IPOTMsgSet
in this template that has a primary message ID
with the given text.
If only_current
is True, then get only current message sets.
If context
is not None, look for a message set with that context
value.
If plural_text
is not None, also filter by that plural text.
If no IPOTMsgSet
is found, return None.
IPOTMsgSet
with the given sequence or None.
The sequence number must be > 0.
Parameters | sequence | The sequence number when the IPOTMsgSet appears. |
Return an iterator over `IPOTMsgSet` objects in this template. :param current: Whether to limit the search to current POTMsgSets. :param prefetch: Whether to prefetch the `POMsgID`s attached to the POTMsgSets. This is for optimization only. :return: All current POTMsgSets for the template if `current` is True, or all POTMsgSets for the template otherwise.
Return all IPOTMsgSet
objects in this template that are translation
credits.
The current argument is used to select only current POTMsgSets or all of them.
Active templates have precedence over inactive ones. Development foci have precendence over non-development foci. Product development foci have precedence over Package development foci.
If there is no POTMsgSet with that id and for that POTemplate, return None.
Return None if there is no such IPOFile
.
Return None if there is no such POFile.
It include all translations available.
IPOFile
for the given language.
Raise LanguageNotFound if the language does not exist in the database.
We should not have already an IPOFile
for the given language_code.
Parameters | language_code | The code of the language for which to create the IPOFile. |
requester | The requester person. If given and will have edit permissions on the IPOFile, it becomes the owner. Otherwise rosetta_experts own the file. | |
create_sharing | Whether the IPOFile should be created in all sharing templates, too. Should only be set to False to avoid loops when creating a new IPOTemplate. |
IPOFile
Raise LanguageNotFound
if the language does not exist in the
database.
This method is designed to be used by read only actions. This way you only create a POFile when you actually need to store data.
We should not have already a POFile for the given language: if check_for_existing is set to False, no check will be done for this.
Parameters | msgid_singular | A reference to a singular msgid. |
msgid_plural | A reference to a plural msgid. Can be None if the message is not a plural message. | |
context | A context for the template message differentiating
it from other template messages with exactly the same msgid . | |
sequence | The sequence number of this POTMsgSet within this POTemplate. If 0, it is considered obsolete. | |
Returns | The newly created message set. |
Similar to createMessageSetFromMessageID, but takes text objects (unicode or string) along with textual context, rather than a message IDs.
Parameters | singular_text | The string for the singular msgid. |
msgid_plural | The string for the plural msgid. Must be None if the message is not a plural message. | |
context | A context for the template message differentiating
it from other template messages with exactly the same msgid . | |
sequence | The sequence number of this POTMsgSet within this POTemplate. If 0, it is considered obsolete. | |
Returns | The newly created message set. |
Finds an existing shared POTMsgSet to use or creates a new one. :param singular_text: string containing singular form. :param plural_text: string containing plural form. :param context: context to differentiate between two messages with same singular_text and plural_text. :param initial_file_references: Initializer for file_references if a new POTMsgSet needs to be created. Will not be set on an existing POTMsgSet. :param initial_source_comment: Initializer for source_comment if a new POTMsgSet needs to be created. Will not be set on an existing POTMsgSet. :return: existing or new shared POTMsgSet with a sequence of 0 in this POTemplate.
Parameters | entry_to_import | TranslationImportQueueEntry specifying an
approved import for this POTemplate |
logger | optional logger to report problems to. | |
txn | optional transaction manager for intermediate commits. Used to prevent long-running transactions that can lead to deadlocks. | |
Returns | a tuple of the subject line and body for a notification email to be sent to the uploader. |
ITranslationPolicy
object.
The returned object is either a Product
or a Distribution
.