Translations/Specs/ExportChangedInLaunchpad

Not logged in - Log In / Register

Export translations that were changed in Launchpad

As a translation maintainer for a project
I want to be able to download only those translation strings from a pofile
that were previously imported from the upstream project and then changed in Launchpad,
to commit those changed translations back to the upstream project.

Implementation of the blueprint export-changed-in-launchpad.

Requirements

User Interface

When the user selects "Download" within the POFile UI, he is presented with the choice of "MO" or "PO" formats. Only if he chooses "PO" will he have the choice of either "Full file" or "Changed in Launchpad". No other UI changes are needed

Analysis of existing code

There is already code to

Export of a PO file

Call Hierarchy

The cron script is doing this:

Issues

Selection of changed translations

POFile has a method getPOTMsgSetChangedInLaunchpad that returns a POTMsgSet with the relevant messages. This is used when all translations for a project are reverted back to the packaged translations. This is too broad and too different to be used for our pupose.

Instead, the above database view will be queried with the extra filters.

Steps in the implementation

Stage 1

This stage is reached when we are able to create exported files from the export queue that contain only the translation strings that were changed in Launchpad. The files still have the header, though, and the entry has to be hacked into the queue.

  1. Turn POFileToTranslationFileDataAdapter into a named adapter and create a second adapter for Changed-In-Launchpad. Use getAdapter to call the adpapter.
  2. Add a new translation file format PO_LPCHANGED and select the right adapter accourding to the file type.
  3. Add a filter parameter to VPOExportSet.get_pofile_rows and apply this filter in the query.

Stage 2

This stage is reached when the exported files fulfill the requirments mentioned above. No UI change yet.

  1. Create a new ITranslationFormatExporter implementation based on or related to GettextPOExporter which is registered for the new file format.
  2. more to follow ...

Stage 3

This stage is reached when the UI for selecting this type of export is available in a static form. All controls are always visible.

Stage 4

This stage is reached when the UI adapts dynamically to just show the filter choice when the applicable format is selected.

Planing code changes

List of files to touch (incomplete).

Translations/Specs/ExportChangedInLaunchpad (last edited 2009-01-27 15:15:21 by henninge)