Menu

#1158 OmegaT does not check errors when tag errors are not present

6.1
open
nobody
None
5
2024-07-19
2023-04-02
No

When tag errors are present, OmegaT checks all the error types.

When tag errors are not present, OmegaT does not try to detect other kinds of errors.

OmegaT should check errors of all types even if there are no tag errors.

Discussion

  • Hiroshi Miura

    Hiroshi Miura - 2023-04-25
    • Group: 5.8 --> 6.1
     
  • Hiroshi Miura

    Hiroshi Miura - 2023-07-03

    TagValidationTool#checkEntry do not have any logic to skip error checks other than no-translated entry.
    Furhter investigation is impossible without reproduceable data and senario.

        /**
         * Checks entry for valid tags.
         *
         * @return An {@link ErrorReport} summarizing the results (will be empty if
         *         no issues found)
         */
        private ErrorReport checkEntry(FileInfo fi, SourceTextEntry ste, TMXEntry te) {
    
            ErrorReport report = new ErrorReport(ste, te);
    
            // if there's no translation, skip the string bugfix for:
            // https://sourceforge.net/p/omegat/bugs/64/
            if (!te.isTranslated() || ste.getSrcText().isEmpty()) {
                return report;
            }
    
            // Check printf variables
            if (Preferences.isPreference(Preferences.CHECK_ALL_PRINTF_TAGS)) {
                TagValidation.inspectPrintfVariables(false, report);
            } else if (Preferences.isPreference(Preferences.CHECK_SIMPLE_PRINTF_TAGS)) {
                TagValidation.inspectPrintfVariables(true, report);
            }
    
            // Extra checks for PO files:
            if (fi.filterClass.getCanonicalName().equals("PoFilter")) {
                TagValidation.inspectPOWhitespace(report);
            }
    
            TagValidation.inspectOmegaTTags(ste, report);
    
            if (Preferences.isPreference(Preferences.CHECK_JAVA_PATTERN_TAGS)) {
                TagValidation.inspectJavaMessageFormat(report);
            }
    
            TagValidation.inspectRemovePattern(report);
    
            return report;
        }
    
     

    Last edit: Hiroshi Miura 2023-07-03
  • Jean-Christophe Helary

    I'll prepare something later. Thank you.

     
    • Hiroshi Miura

      Hiroshi Miura - 2023-12-08

      When no reproducible given, I'd like to close the issue.

       
      • Jean-Christophe Helary

        Sorry, it's on my "todo" list. I'll be on it shortly.

         
  • Jean-Christophe Helary

     
  • Kos Ivantsov

    Kos Ivantsov - 2024-07-19

    I think the more consistent behavior would be for this option to be renamed to reflect that it deals with tags (its intention is rather obvious from the code). And then this option and the option in the Preferences > Tag Processing that prevents creating target documents with tag issues should temporarily disable any other checks selected in the Check Issues and cover only tags.

    Both of these options are about files validity, not about QA.

     
    • Jean-Christophe Helary

      What I’d like to know is whether the function was coded before we had all the other checks and then forgotten about, hence the inconsistency that we need to fix, or if it intended to leave them aside, in which case I'd be fine with temporarily reverting the labels.

      I wrote that bug report because I wanted OmegaT to check for all the issues on leaving the segment and it did not do that.

       
      • Kos Ivantsov

        Kos Ivantsov - 2024-07-19

        What I’d like to know is whether the function was coded before we had all the other checks and then forgotten about, hence the inconsistency that we need to fix, or if it intended to leave them aside, in which case I'd be fine with temporarily reverting the labels.

        When it was added, we had only tag validation. Everything else was (and still is) available in the QA script. Then tag validation was retired and superseded by the Check Issues which is designed to be extendable by scripts and plugins. When it was done, I think very little though was given to automatic tag validation which would happen when leaving a segment and creating target files. Tag validation is relatively simple task as far as computing goes, but even on medium-sized projects it might slow things down. Add to that compute-hungry terminology checks and LanguageTool, and it becomes a real annoyance if it pops up every now and then.

        I wrote that bug report because I wanted OmegaT to check for all the issues on leaving the segment and it did not do that.

        Fair enough, but I think with the current implementation of the Check Issues function with the scope always being an entire current document, it is not a very good idea. If somehow the check could be limited to the segment only, that would be quite helpful.

         
        • Jean-Christophe Helary

          I totally agree with you about limiting the scope to the current segment, in that particular case.

           

Log in to post a comment.