l.t.i.w.IPOFile(IRosettaStats) : interface documentation

Part of lp.translations.interfaces.webservice View In Hierarchy

A translation file.
Object potemplate Undocumented
Choice language Undocumented
TextLine title Undocumented
Text description Undocumented
Text topcomment Undocumented
Text header The standard translation header in its native format.
Bool fuzzyheader Undocumented
Object lasttranslator Undocumented
Datetime date_changed Undocumented
Datetime lastparsed Undocumented
Choice owner The owner of the translation file in Launchpad can edit its
TextLine path Undocumented
Datetime datecreated Undocumented
List translators Translators designated as having permission to edit these files
List contributors Undocumented
Choice translationpermission The permission system which is used for this translation file.
Field from_sourcepackagename The source package this pofile comes from (set it only if it's
Attribute translation_messages All ITranslationMessage objects related to this translation file.
Int plural_forms Number of plural forms is a number of translations provided for
Method getOtherSidePOFile Get the POFile for the same language on the other side.
Method translatedCount Returns the number of message sets which this PO file has current
Method untranslatedCount Return the number of messages which this PO file has no translation
Method hasPluralFormInformation Do we know the plural-forms information for this POFile?
Method getHeader Return an ITranslationHeaderData representing its header.
Method findPOTMsgSetsContaining Get POTMsgSets where English text or translation contain text.
Method getPOTMsgSetTranslated Get pot messages that are translated for this translation file.
Method getPOTMsgSetUntranslated Get pot message sets that are untranslated for this file.
Method getPOTMsgSetWithNewSuggestions Get pot message sets with suggestions submitted after last review.
Method getPOTMsgSetDifferentTranslations Get pot message sets with different translations on both sides.
Method getTranslationsFilteredBy Get TranslationMessages in this IPOFile contributed by person.
Method getTranslationMessages Get TranslationMessages in this IPOFile.
Method export Export this PO file as string.
Method prepareTranslationCredits Add Launchpad contributors to translation credit strings.
Method canEditTranslations Whether the given person is able to add/edit translations.
Method canAddSuggestions Whether the given person is able to add new suggestions.
Method getStatistics Summarize this file's cached translation statistics.
Method updateStatistics Update the cached statistics fields.
Method updateHeader Update the header information.
Method isTranslationRevisionDateOlder Whether given header revision date is newer then self one.
Method setPathIfUnique Set path to given one, provided it's a valid, unique path.
Method importFromQueue Import given queue entry.
Method getFullLanguageCode Return the language code.
Method getFullLanguageName Return the language name.
Method getTranslationRows Return exportable rows of translation data.
Method getChangedRows Return exportable rows that differ from upstream translations.
Method markChanged Note a change to this POFile or its contents.

Inherited from IRosettaStats:

Method testStatistics Ensure that the statistics here are self-consistent.
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 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
potemplate =
Undocumented
language =
Undocumented
title =
Undocumented
description =
Undocumented
topcomment =
Undocumented
header =
The standard translation header in its native format.
fuzzyheader =
Undocumented
lasttranslator =
Undocumented
date_changed =
Undocumented
lastparsed =
Undocumented
owner =
The owner of the translation file in Launchpad can edit its translations and upload new versions.
path =
Undocumented
datecreated =
Undocumented
translators =
Translators designated as having permission to edit these files in this language.
contributors =
Undocumented
translationpermission =
The permission system which is used for this translation file. This is inherited from the product, project and/or distro in which the pofile is found.
from_sourcepackagename =
The source package this pofile comes from (set it only if it's different from IPOFile.potemplate.sourcepackagename).
translation_messages =
All ITranslationMessage objects related to this translation file.
plural_forms =
Number of plural forms is a number of translations provided for each plural form message. If IPOFile.language does not specify plural forms, it defaults to 2, which is the most common number of plural forms.
def getOtherSidePOFile():
Get the POFile for the same language on the other side.

Follow the packaging link to find in the sharing template on the other side and get the POFile from there. Returns None if no link exists.

def translatedCount():
Returns the number of message sets which this PO file has current translations for.
def untranslatedCount():
Return the number of messages which this PO file has no translation for.
def hasPluralFormInformation():
Do we know the plural-forms information for this POFile?
def getHeader():
Return an ITranslationHeaderData representing its header.
def findPOTMsgSetsContaining(text):
Get POTMsgSets where English text or translation contain text.
def getPOTMsgSetTranslated():
Get pot messages that are translated for this translation file.
def getPOTMsgSetUntranslated():
Get pot message sets that are untranslated for this file.
def getPOTMsgSetWithNewSuggestions():
Get pot message sets with suggestions submitted after last review.
def getPOTMsgSetDifferentTranslations():
Get pot message sets with different translations on both sides.
def getTranslationsFilteredBy(person):
Get TranslationMessages in this IPOFile contributed by person.

Returned messages are ordered by the POTMsgSet, and then by date_created with newest first.

def getTranslationMessages(condition=None):
Get TranslationMessages in this IPOFile.

If condition is None, return all messages, else narrow the result set down using the condition.

def export(ignore_obsolete=False, export_utf8=False):
Export this PO file as string.
Parametersignore_obsoleteWhether the exported PO file does not have obsolete entries.
export_utf8Whether the exported PO file should be exported as UTF-8.
def prepareTranslationCredits(potmsgset):
Add Launchpad contributors to translation credit strings.

It adds to the translation for potmsgset if it exists, trying not to repeat same people who are already credited.

def canEditTranslations(person):
Whether the given person is able to add/edit translations.
def canAddSuggestions(person):
Whether the given person is able to add new suggestions.
def getStatistics():
Summarize this file's cached translation statistics.
Returnstuple of (currentcount, updatescount, rosettacount, unreviewed_count), as collected by updateStatistics.
def updateStatistics():
Update the cached statistics fields.
Returnsa tuple (currentcount, updatescount, rosettacount, unreviewed_count), as for getStatistics.
def updateHeader(new_header):
Update the header information.

new_header is a POHeader object.

def isTranslationRevisionDateOlder(header):
Whether given header revision date is newer then self one.
def setPathIfUnique(path):
Set path to given one, provided it's a valid, unique path.

A POFile's path must be unique within its context, i.e. for either the same DistroSeries and SourcePackageName, or for the same ProductSeries, depending on which the POFile is attached to.

If the new path is not unique, the old path will be retained instead.

def importFromQueue(entry_to_import, logger=None, txn=None):
Import given queue entry.
Parametersentry_to_importTranslationImportQueueEntry specifying an approved import for this POFile
loggeroptional logger to report problems to.
txnoptionally, a transaction manager. It will not be used; it's here only for API symmetry with IPOTemplate.
Returnsa tuple of the subject line and body for a notification email to be sent to the uploader.
def getFullLanguageCode():
Return the language code.
def getFullLanguageName():
Return the language name.
def getTranslationRows():
Return exportable rows of translation data.
Returnsa list of VPOExport objects.
def getChangedRows():
Return exportable rows that differ from upstream translations.
Returnsa list of VPOExport objects.
def markChanged(translator=None, timestamp=None):
Note a change to this POFile or its contents.
ParameterstranslatorThe person making this change. If given, lasttranslator will be updated to refer to this person.
timestampTime of the change. Defaults to "now."
API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.