Comment 5 for bug 222221

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

KDE's implementation of plurals makes the two msgids look different to gettext, which is why gettext fails to detect the clash. (With gettext's built-in plurals support it would be an error).

Launchpad supports KDE plural forms natively, so it sees the two messages as having the same (singular) msgid and ignores one of them. The difference in behaviour, where some cases go right and others go wrong, is probably caused by differences in message ordering while importing files.

We can change that by making plural msgids a part of the message's lookup key:
 * Add msgid_plural to the unique constraints on (potemplate, context, msgid).
 * Make the KDE gettext importer warn about the duplication, but accept it otherwise.
 * Make sure the regular gettext importer checks for duplicate msgids and treats them as errors.
 * Leave the KDE gettext exporter unchanged: it will happily export the two messages with their translations.
 * Where duplication occurs, make the regular gettext exporter eliminate the plural-less one.