Diff for "Translations/Specs/ExportChangedInLaunchpad"

Not logged in - Log In / Register

Differences between revisions 1 and 2
Revision 1 as of 2009-01-16 12:46:27
Size: 2384
Editor: henninge
Comment:
Revision 2 as of 2009-01-16 12:47:18
Size: 2384
Editor: henninge
Comment:
Deletions are marked like this. Additions are marked like this.
Line 35: Line 35:
POFile has a method getPOTMsgSetChangedInLaunchpad that returns a POTMsgSet with the relevant messages. This could be adapted to ITranslationFileData like POFile itself but then it would not use the export view. What is the difference between the view and the query in this method. POFile has a method getPOTMsgSetChangedInLaunchpad that returns a POTMsgSet with the relevant messages. This could be adapted to ITranslationFileData like POFile itself but then it would not use the export view. What is the difference between the view and the query in this method?

Export translations that were changed in Launchpad

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

Analysis of existing code

There is already code to

  • Export files in PO format
  • Select only those files that where changed in Launchpad (for display)

Export of a PO file

Call Hierarchy

The cron script is doing this:

  • scripts.po_export_py.process_request:161 -> ITranslationExporter.getExporterProducingTargetFileFormat

    • pofile.zcml.subscriber:30 -> GettextPOExporter

    scripts.po_export_py.process_request:183 -> generate_translatoinfiledata

    • scripts.po_export_py.generate_translatoinfiledata:149 -> ITranslationFileData(IPOFile)

      • pofile.zcml.adapter:23 -> POFileToTranslationFileDataAdapter

        • database.pofile.py.POFileToTranslationFileDataAdapter.init:1277 -> _getMessages

          • database.pofile.py.POFileToTranslationFileDataAdapter._getMessages:1359 -> get_pofile_rows

            • database.vpoexport.py.VPOExportSet.get_pofile_rows:117 -> _select

              • database.vpoexport.py.VPOExportSet.get_pofile_rows:94 -> cur.execute database.vpoexport.py.VPOExportSet.get_pofile_rows:97 -> yield VPOExport

    scripts.po_export_py.process_request:182 -> exportTranslationFiles

    • translationformat.gettext_po_exporter.exportTranslationFiles

Issues

  • The export uses the POExport view and selects the relevant messages from in get_pofile_rows. This select could be adapted to retrieve only the changed rows.
  • The ITranslationFormatExporter is selected using the file format but this has no influence on generate_translationfiledata. This information would have to be passed down to get_pofile_rows.
  • A seperate ITranslationFormatExporter is needed for this because the file will ommit the header, and add a warning, too. This should share code with the existing POFormatExporter.

Selection of changed translations

POFile has a method getPOTMsgSetChangedInLaunchpad that returns a POTMsgSet with the relevant messages. This could be adapted to ITranslationFileData like POFile itself but then it would not use the export view. What is the difference between the view and the query in this method?

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