l.t.u.translationmerger : module documentation

Part of lp.translations.utilities

No module docstring
Function get_potmsgset_key Get the tuple of identifying properties of a POTMsgSet.
Function merge_pofiletranslators Merge POFileTranslator entries from one template into another.
Function merge_translationtemplateitems Merge subordinate POTMsgSet into its representative POTMsgSet.
Function filter_clashes Filter clashes for harmless clashes with an identical message.
Function sacrifice_flags Drop current/imported flags if held by any of incumbents.
Function bequeathe_flags Destroy source_message, leaving flags to target_message.
Class MessageSharingMerge No class docstring; 1/3 methods documented
Class TransactionManager Manage transactions for script runs.
Class TranslationMerger Merge translations across a set of potemplates.
Class MergeExistingPackagings Script to perform translation on existing packagings.
def get_potmsgset_key(potmsgset):
Get the tuple of identifying properties of a POTMsgSet.

A POTMsgSet is identified by its msgid, optional plural msgid, and optional context identifier.

def merge_pofiletranslators(from_template, to_template):
Merge POFileTranslator entries from one template into another.
def merge_translationtemplateitems(subordinate, representative, representative_template):
Merge subordinate POTMsgSet into its representative POTMsgSet.

This adds all of the subordinate's TranslationTemplateItems to the representative's set of TranslationTemplateItems.

Any duplicates are deleted, so after this, the subordinate will no longer have any TranslationTemplateItems.

def filter_clashes(clashing_ubuntu, clashing_upstream, twin):
Filter clashes for harmless clashes with an identical message.

Takes the three forms of clashes a message can have in a context
it's being merged into:
 * Another message that also has the is_current_ubuntu flag.
 * Another message that also has the is_current_upstream flag.
 * Another message with the same translations.

If either of the first two clashes matches the third, that is not a
real clash since it can be resolved by merging the message into the
twin.

This function returns the same tuple but with these "harmless"
clashes eliminated.
def sacrifice_flags(message, incumbents=None):
Drop current/imported flags if held by any of incumbents.
Parametersmessagea TranslationMessage to drop flags on.
incumbentsa sequence of reference messages. If any of these has either is_current_ubuntu or is_current_upstream set, that same flag will be dropped on message (if set).
def bequeathe_flags(source_message, target_message, incumbents=None):
Destroy source_message, leaving flags to target_message.

If source_message holds the is_current_ubuntu flag, and there are no incumbents that hold the same flag, then target_message inherits it. Similar for the is_current_upstream flag.

API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.