gettext parser stumbles over "#~|"

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

Bug Description

Some gettext files combine the "#~" marker (for obsolete messages) with the "#|" one (for fuzzy messages' previous msgids) to produce "#~|". The parser ignores "#|" but tries to make sense of "#~", and then fails because it next sees "|".

Simplest fix for this is to ignore lines that start with "#~|". (See also bug 182895).

description: updated
Changed in rosetta:
assignee: nobody → jtv
importance: Undecided → High
milestone: none → 2.1.11
status: New → In Progress
Revision history for this message
Colin Watson (cjwatson) wrote :

This is a serious issue for Kubuntu, since many of its critical components ran into this bug. We are going to work around this for 8.10 (since time is of the essence) by providing Jeroen with a translations tarball from which all lines starting with "#~|" have been stripped. Jonathan sent this to Jeroen earlier today and we're waiting for feedback now.

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

Action was delayed because the tarball arrived too late in the night for me, and still contained the "#~|" lines. The upload was complicated by the fact that KDE bundles its translations by language, not by source package. Our upload approver has some special-casing for the KDE language packs to find the appropriate package and template for each translation file, and derive its language form the package name instead of the filename.

Unfortunately distro package translations must be uploaded to the package holding the actual template, and in fact to the right template. Since the KDE language pack packages do not hold the actual templates, we can't upload the tarballs to there in their original form. This means that the approver's special logic for KDE tarballs can't be used, and must be reproduced client-side.

Thus after finding the right packages and templates, the PO files must also be named differently (after the language codes, not after the template) for the auto-approver to understand what language they're in. I developed a script to unpack the tarballs, strip out the bad lines, decode KDE language codes, rename the translation files, tar them up by template instead of by language, help figure out what package each template is actually in, and upload the tarballs to the right places.

The script has been run and the files are now importing. Luckily our partition of templates across packages mostly matches that of upstream.

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

Fixed in RF 7306.

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.