Code review comment for lp:~jtv/launchpad/validate-translations-file

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

= Bug 503382 =

For Firefox in particular, in order to detect problems with broken translation files early and stay tightly coupled to upstream, the Ubuntu folks need to test translation files for syntax errors and such that would prevent them from importing into Launchpad.

In the case of Firefox (which uses XPI archives for translation, not gettext), a complication is that the upstream files are available as raw files that, on build, would go into an XPI archive. The main type of file to check is DTD files. We need to check these without building full XPI files, but the organization of files within XPI archives can be different from the directory hierarchies in the revision-controlled source tree.

This branch adds a script that parses translations files in a variety of formats. Only DTD and manifest files were requested, but adding a few formats was easy enough and may come in handy.

Note that this is not a full LaunchpadScript, although I did borrow a few snippets of setup code from there. It does not need locking, activity monitoring, etc. but standard options like -v can be useful.

One of the tests re-uses the XPI helpers that currently live in lp.translations.utilities.tests. Maybe those should be moved, though I'm not sure where.

Test with:
{{{
./bin/test -vv -t validate_translations_file
}}}

No lint. To Q/A, run the new script against a variety of files in these formats.

Jeroen

« Back to merge proposal