Late import of c-format flag causes inconsistent data

Bug #317578 reported by Данило Шеган
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Launchpad itself
Triaged
High
Unassigned

Bug Description

For translatable messages that represent (for example) C format strings, the formatting conversions in the translation must be compatible with those of the original message. As long as the c-format flag is set to indicate that the message is a C format string, you can't translate msgid "Blah" with msgstr "Foo %d". Neither gettext nor Launchpad will accept it.

But if the c-format flag is omitted when the mistake is first made, and then a later template update sets the c-format flag without changing the msgid, we end up with inconsistent data. The message is now in that state in which neither gettext nor Launchpad would accept it.

A good way to deal with this would be to demote the translation to a suggestion with validation_status == UNKNOWN_ERROR.

We need to watch for interactions with super-fast-imports.

Bug 312130 might be mildly related (at least in the practical sense, not much code-wise).

Changed in rosetta:
importance: Undecided → High
status: New → Triaged
Revision history for this message
Данило Шеган (danilo) wrote :

Jeroen has been working on cleaning up the data, fixing the bug properly will require a lot more attention (like how not to avoid slowing down entire LP).

Changed in rosetta:
assignee: nobody → jtv
description: updated
Revision history for this message
Jeroen T. Vermeulen (jtv) wrote :

Separated out the cleanup of existing data into bug 319153. Working on that one.

So now this bug can be entirely about stopping the problem from happening.

Changed in rosetta:
assignee: Jeroen T. Vermeulen (jtv) → nobody
Revision history for this message
David Planella (dpm) wrote :

Additional note: it seems that 'msgfmt --check-format' does not catch errors in correctly flagged python-format strings. Try the attachment with incorrect plurals missing the %d variable. I reported someting similar in bug 456210, which I then marked as duplicate of this one.

I've seen this happening in #kde-format strings as well (bug 363414, bug 425254, bug 425226), so I should probably check out if gettext catches errors there.

This also makes it difficult to catch things like bug 409785 and bug 363990 early.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Bug attachments

Remote bug watches

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