KeyError for excessive plural forms

Bug #319243 reported by Jeroen T. Vermeulen
2
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
Medium
Jeroen T. Vermeulen

Bug Description

The latest Hausa translation for nautilus in Jaunty did something funny: it tried to translate a message to 28 plural forms! Launchpad only supports 6 forms, so at form 6 (counting from 0) we get a KeyError in the gettext parser instead of a proper error report to the user:

https://pastebin.canonical.com/12894/

In POParser._dumpCurrentSection, one of the arguments to self._message.addTranslation is self._plural_form_mapping[self._plural_case], which in this case doesn't exist.

Various syntax-colouring stop recognizing this as valid after plural form 9. If that is correct, then forms 6—9 inclusive should be reported as unsupported in Launchpad and forms 10 or higher perhaps as syntax errors.

It'd be best to intercept this weirdness right where it lands, where _parseFreshLine recognizes that msgstr is followed by an opening bracket ("if line.startswith('['):") and before it checks that the plural numbers are nearly consecutive.

The offending message is at https://pastebin.canonical.com/12893/

Original upload is at http://launchpadlibrarian.net/21460184/ha.po

Revision history for this message
Данило Шеган (danilo) wrote :

Related to bug #187655.

Changed in rosetta:
importance: Undecided → Medium
status: New → Triaged
Changed in rosetta:
assignee: nobody → jtv
status: Triaged → In Progress
Changed in rosetta:
milestone: none → 2.2.4
Revision history for this message
Jeroen T. Vermeulen (jtv) wrote :

Fixed in RF 8155

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.