Part of lp.translations.model.translationimportqueue View In Hierarchy
Method | sourcepackage | See ITranslationImportQueueEntry. |
Method | guessed_potemplate | See ITranslationImportQueueEntry. |
Method | canAdmin | See ITranslationImportQueueEntry . |
Method | canEdit | See ITranslationImportQueueEntry . |
Method | canSetStatus | See ITranslationImportQueueEntry . |
Method | setStatus | See ITranslationImportQueueEntry . |
Method | setErrorOutput | See ITranslationImportQueueEntry . |
Method | addWarningOutput | See ITranslationImportQueueEntry . |
Method | import_into | See ITranslationImportQueueEntry. |
Method | reportApprovalConflict | Report an approval conflict. |
Method | matchPOTemplateByDomain | Attempt to find the one matching template, by domain. |
Method | getGuessedPOFile | See ITranslationImportQueueEntry . |
Method | getFileContent | See ITranslationImportQueueEntry. |
Method | getTemplatesOnSameDirectory | See ITranslationImportQueueEntry. |
Method | getElapsedTimeText | See ITranslationImportQueue. |
Method | _guessed_potemplate_for_pofile_from_path | Return an IPOTemplate that we think is related to this entry. |
Method | _guessed_pofile_from_path | Return an IPOFile that we think is related to this entry. |
Method | _findCustomLanguageCode | Find applicable custom language code, if any. |
Method | _guessLanguage | See ITranslationImportQueueEntry. |
Method | _get_pofile_from_language | Return an IPOFile for the given language and domain. |
Method | _guess_multiple_directories_with_pofile | Return IPOFile that we think is related to this entry, or None. |
Inherited from SQLBase:
Method | __init__ | Extended version of the SQLObjectBase constructor. |
Method | __repr__ | Undocumented |
Method | destroySelf | Undocumented |
Method | __eq__ | Equality operator. |
Method | __ne__ | Inverse of __eq__. |
Method | __storm_invalidated__ | Flush cached properties. |
Class Method | _get_store | Undocumented |
Return an `IPOTemplate` that we think is related to this entry. We make this guess by matching the path of the queue entry with those of the `IPOTemplate`s for the same product series, or for the same distro series and source package name (whichever applies to this request). So if there is a candidate template in the same directory as the request's translation file, and we find no other templates in the same directory in the database, we have a winner.
We get it based on the path it's stored or None.
Looks within the context of the queue entry. If multiple templates match, reports an approval conflict.
Parameters | domain | Translation domain to look for. |
sourcepackagename | Optional SourcePackageName to look for.
If not given, source package name is not considered in the
search. | |
Returns | A single POTemplate , or None. |
Parameters | lang_code | The language code we are interested on. |
translation_domain | The translation domain for the given language. | |
sourcepackagename | The ISourcePackageName that uses this translation or None if we don't know it. |
IPOFile
that we think is related to this entry, or None.
Multi-directory tree layouts are non-standard layouts where the .pot file and its .po files are stored in different directories. We only know of this happening with gettext files.
The known layouts are:
DIRECTORY/TRANSLATION_DOMAIN.pot DIRECTORY/LANG_CODE/TRANSLATION_DOMAIN.po
or
DIRECTORY/TRANSLATION_DOMAIN.pot DIRECTORY/LANG_CODE/messages/TRANSLATION_DOMAIN.po
or
DIRECTORY/TRANSLATION_DOMAIN.pot DIRECTORY/LANG_CODE/LC_MESSAGES/TRANSLATION_DOMAIN.po
or
DIRECTORY/TRANSLATION_DOMAIN.pot DIRECTORY/LANG_CODE/LANG_CODE.po
where DIRECTORY would be any path, even '', LANG_CODE is a language code and TRANSLATION_DOMAIN the translation domain is the one used for that .po file.
If this isn't enough, there are some packages that have a non standard layout where the .pot files are stored inside the sourcepackage with the binaries that will use it and the translations are stored in external packages following the same language pack ideas that we use with Ubuntu.
This layout breaks completely Rosetta because we don't have a way to link the .po and .pot files coming from different packages. The solution we take is to look for the translation domain across the whole distro series. In the concrete case of KDE language packs, they have the sourcepackagename following the pattern 'kde-i18n-LANGCODE' (KDE3) or kde-l10n-LANGCODE (KDE4).