l.t.i.t.ITranslationImporter(Interface) : interface documentation

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

Importer of translation files.
List supported_file_extensions Undocumented
TextLine template_suffixes Undocumented
Method isTemplateName Based on filename, is this a template file?
Method isTranslationName Based on filename, is this file a translation?
Method isHidden Based on filename, is this a hidden file?
Method getTranslationFileFormat Return the translation file format for the given file extension.
Method getTranslationFormatImporter Return the translation format importer for the given file format.
Method importFile Import an ITranslationImportQueueEntry file into the system.
supported_file_extensions =
Undocumented
template_suffixes =
Undocumented
def isTemplateName(path):
Based on filename, is this a template file?
Parameterspathfile name, possibly including directory component.
ReturnsBoolean: True if path identifies this file as a template.
def isTranslationName(path):
Based on filename, is this file a translation?
Parameterspathfile name, possibly including directory component.
ReturnsBoolean: True if path identifies this file as a translation. A template, or a file with an unknown filename extension, is not considered a translation.
def isHidden(path):
Based on filename, is this a hidden file?
Parameterspathfile name, possibly including directory component.
ReturnsBoolean: True if path contains either a hidden file or a hidden directory.
def getTranslationFileFormat(file_extension, file_contents):
Return the translation file format for the given file extension.
Parametersfile_extensionFile extension including the dot.
file_contentsFile contents (a seekable file object).
ReturnsA TranslationFileFormat for the given file extension and file contents or None if it's not supported format.
def getTranslationFormatImporter(file_format):
Return the translation format importer for the given file format.
Parametersfile_formatA TranslationFileFormat entry.
ReturnsAn ITranslationFormatImporter or None if there is no handler for the given file format.
def importFile(translation_import_queue_entry):
Import an `ITranslationImportQueueEntry` file into the system.

:param translation_import_queue_entry: An
    `ITranslationImportQueueEntry` entry.
:raise OutdatedTranslationError: If the entry is older than the
    previously imported file.
:raise NotExportedFromLaunchpad: If the entry imported is not
    from upstream and doesn't have the tag added by Launchpad on
    export time.
:return: a tuple of two lists: error descriptors, and warnings.

The errors list contains dictionaries describing messages that
couldn't be imported.  Each of those has three keys:
    - 'pomsgset': An `IPOMsgSet` associated with this error.
    - 'pomessage': The original message text in its native format.
    - 'error-message': The error message text.

The warnings list is simply a list of warning strings.
API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.