KDE: plural form + non-plural form = mixed (broken) export

Bug #222221 reported by Harald Sitter
This bug report is a duplicate of:  Bug #203349: Broken plural forms in KDE. Edit Remove
8
Affects Status Importance Assigned to Milestone
Launchpad itself
Triaged
High
Unassigned

Bug Description

My investigation on this issue:

First install language-pack-kde-de on ubuntu 8.04, then run
msgunfmt /usr/share/locale-langpack/de/LC_MESSAGES/amarok.mo > amarok.po
and open the resulting amarok.po in an editor -> search for 'Edit Track &Information'.
The result will be:
> msgid ""
> "_n: Edit Track &Information...\n"
> "Edit &Information for %n Tracks..."
> msgstr "&Metadaten bearbeiten ..."
which is resulting in an awfully broken translation since msgid is a plural form, and msgstr is not.

The reason for this issue lies within the imported amarok.po (see attachment)
Searing it for 'Edit Track &Information' brings up:
> msgid ""
> "_n: Edit Track &Information...\n"
> "Edit &Information for %n Tracks..."
> msgstr ""
> "&Metadaten bearbeiten ...\n"
> "&Metadaten für %n Stücke bearbeiten ..."
AND
> msgid "Edit Track &Information..."
> msgstr "&Metadaten bearbeiten ..."

Therefore my assumption is that it is actually mixing the plural form msigd with the non-plural msgstr - which results
a) in a non translated string
b) a recognized broken translation (see screenshot)

This issue is actually pretty serious since it effects _all_ languages and the teams can't do anything about it, it probably also effects more applications than just Amarok, according to a friend of mine it apparently is appearing in Konversation as well.

Revision history for this message
Harald Sitter (apachelogger) wrote :
Revision history for this message
Harald Sitter (apachelogger) wrote :
Revision history for this message
Harald Sitter (apachelogger) wrote :

Ubuntu bug #203349 is the associated report about the resulting issues.

Beside Amarok there are also reports for KTorrent, the package manager Adept and the file manager Dolphin.

Revision history for this message
Harald Sitter (apachelogger) wrote :

Further research revealed a related but other export issue with plural-forms:
In Dolphin/D3lphin the break only appears in some translations, I compared fr and de.

Ubuntu package:
--fr--
> msgid ""
> "_n: 1 Item\n"
> "%n Items"
> msgstr ""
> "1 élément\n"
> "%n éléments"

A completely correct plural form.

--de--
> msgid ""
> "_n: 1 Item\n"
> "%n Items"
> msgstr "Ein Element"

Same issue as for Amarok

From looking at https://translations.edge.launchpad.net/ubuntu/hardy/+source/dolphin/+pots/d3lphin/fr/+translate?start=100 and https://translations.edge.launchpad.net/ubuntu/hardy/+source/dolphin/+pots/d3lphin/de/+translate?start=100 we see that de doesn't have a plural form and apparently Rosetta exports the plural-form translation, because of the missing plural translation, as normal string which leads to the same result as the original issue with Amarok.

I also tried to find the Amarok string in Rosetta, but since there are about 2500 strings for Amarok I wasn't very successful. You can probably do a query on the database and find out whether Amarok's issue might be partly caused by the same export error. Eitherway Rosetta would still be eating the non-plural string and therefore cause untranslated strings in the UI (as seen in the new screenshot)

Changed in rosetta:
importance: Undecided → High
milestone: none → 1.2.5
status: New → Confirmed
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.

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.