[WIP] Run msgfmt on translation files upon saving
Needs ReviewPublic

Authored by adrianchavesfernandez on Jun 13 2018, 9:11 PM.

Details

Reviewers
shaforostoff
Summary

The goal of this task is to implement the feature request at https://bugs.kde.org/show_bug.cgi?id=198872

The plan is:

  1. Implement the following:
    • Upon saving a translation file, before the file is actually saved, check if the new file content passes the msgfmt checks.
      • If it does not pass the checks, show a dialog box.

        This dialog box should be similar to the one that appears when you try to close Lokalize while having open files with unsaved changes, but with the following differences:
        • A different icon, one that suggest an error notification, rather than a warning.
        • The following choices:
          • Show Issues

            It cancels the file saving, and does something similar to what pology does, showing only messages with issues, and displaying the issues on the comments panel.
          • Save Anyway
          • Cancel
      • If they do pass the checks, go on and save the file.
      • If the msgfmt executable is not callable, exits with an unexpected status or returns unexpected output, log details about the error to stdout, then go on and save the file.
  2. Update the automated tests to provide complete coverage of the new code.
  3. Update the user-facing documentation as needed.
Test Plan

Manual tests of all the described workflows, and automated tests covering all modified code.

Diff Detail

Repository
R456 Lokalize
Lint
Lint Skipped
Unit
Unit Tests Skipped
adrianchavesfernandez requested review of this revision.Jun 13 2018, 9:11 PM
adrianchavesfernandez created this revision.

sorry, where is implemetation of showIssues()?

sorry, where is implemetation of showIssues()?

There is none yet (hence [WIP]), and I’ve not worked on it for some time now, as I am currently focusing on Galician translations instead. Feel free to pick it up, let someone pick it up, or even close it as abandoned.