Exports and diverged messages

Bug #393763 reported by Jeroen T. Vermeulen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
High
Jeroen T. Vermeulen

Bug Description

It looks to me as if we may be including diverged TranslationMessages in translation exports where they shouldn't be included.

The POExport view joins a TranslationMessage to all POTemplates that use its POTMsgSet. It keeps a separate "diverged" FK to TranslationMessage.potemplate. That's good design, but I don't see anything to filter out cases where diverged is neither null nor equal to potemplate. In other words, messages that are diverged but for a different template.

Next, POFile._getMessages (which processes the rows from POExport) properly gives precedence to diverged messages over shared ones—but doesn't check that they are diverged to the current POTemplate rather than to some other POTemplate that it shares with.

We could solve this in at least three ways:

1. In the view: "WHERE diverged IS NULL OR diverged = potemplate." May make the SQL slower but will also return fewer rows, which is good.

2. In POFile._getMessages:
    if row.diverged == row.potemplate:
        diverged_messages.append(msg_key)
    elif row.diverged is None:
        # This message is shared.
        if msg_key in diverged_messages:
            continue
    else:
        # This diverged message belongs to a different template.
         continue

3. In VPOExport: replace get_pofile_rows and get_pofile_changed_rows with versions that go straight to the relevant tables. Then we won't need the POExport view at all.

I'd prefer solution 3 in the end, but 1 or 2 are easier short-term fixes.

Revision history for this message
Jeroen T. Vermeulen (jtv) wrote :

(When fixing this, have a look at bug 393765 also).

description: updated
description: updated
summary: - Language packs and diverged messages
+ Exports and diverged messages
description: updated
Changed in rosetta:
importance: Undecided → High
milestone: none → 2.2.7
status: New → Triaged
tags: added: message-sharing
Changed in rosetta:
status: Triaged → In Progress
assignee: nobody → Jeroen T. Vermeulen (jtv)
Revision history for this message
Jeroen T. Vermeulen (jtv) wrote :

Fixed in devel 8775

Changed in rosetta:
status: In Progress → Fix Committed
Changed in rosetta:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.