Launchpad Translations housekeeping information
Here's a grab-bag of useful things to know when managing Launchpad Translations. We'll give this more structure as it develops.
Things that come up in logs
Some of the things you may see logged by our cron jobs.
Outdated POFile statistics
The nightly cron job goes over the cached !POFile statistics, recomputing them to ensure that any errors don't stay around, and warning us if any of them are out of sync.
Ideally the translations should never be out of sync during normal operation but there can be some skew:
- When a template is imported, that affects the statistics for all its translations. They are recomputed, but it's possible that other processes made changes in the meantime that aren't visible to the transaction that does the recomputing.
- Other concurrent updates may "confuse" each other as well, e.g. two simultaneous updates may both increase the number of translated messages from 131 to 132. In that case one of the increments may be lost.
- When we copy translations directly in the database, the statistics are copied along. Those will be wrong for the new files. (We don't update them as part of the copy exactly because the cron job will set them straight anyway).
- If we mess with the database manually, that may invalidate some of the statistics.
- There may be bugs where the statistics are not always "live-updated" correctly as changes are made. If there are, their effect is currently "lost in the noise."
Matching translations to existing messages
When POTMsgSet.updateTranslation is called to set a message's translations in the database, it first looks for a matching TranslationMessage that it can activate instead of entering new data.
Very rarely it will find more than one match, because one or more messages have additional translations for plural-forms that the language is not supposed to have. This may be indicative of a bug if it starts happening a lot (we don't want unnecessary duplication, after all) but the occasional instance doesn't hurt.
KDE approvals and clashing translation domains
Sometimes you may see messages like this from the auto-approval script:
WARNING Found multiple templates with translation domain 'libkscreensaver'. There should be only one.
This happens in a special case for Ubuntu KDE uploads. Soyuz uploads these translations in special language-pack packages, i.e. grouped by language instead of actual software package. For this special case, the approver must find the right template not in the same package the upload was for, but in a different package. It does this by finding active ("iscurrent") templates in the same distroseries whose translation domain matches the naming of the translation file in its language pack. It then attaches the upload to that template, moving it to the template's package.
When the distroseries has more than one matching template, the approver issues this warning. Fix it by finding the two (or more) templates with the same translation domain and distroseries, and either rename one or disable one.
gettext parser warnings
We sometimes log warnings about things that are not quite fatal errors, but give our parsers pause. This can happen while importing a file or while exporting a file—possibly as part of a language pack.
In the future, the import warnings should be logged to the user instead; the export warnings should be fixed or suppressed.