[WIP] Run msgfmt on translation files upon saving
Open, Needs TriagePublic

Description

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.

@shaforostoff Could you have a look at my high-level plan, see if I am missing something? Maybe another scenario that also triggers the saving of a file?

adrianchavesfernandez renamed this task from Run msgfmt on translation files upon saving to [WIP] Run msgfmt on translation files upon saving.Jun 13 2018, 9:08 PM