Uploaded image for project: 'translate5'
  1. translate5
  2. TRANSLATE-858

Integrate languagetool grammer, style and spell checker as micro service

    XMLWordPrintable

Details

    Description

      General integration: Step 1

      • the integration should be done as generic as possible to allow the later integration of other spell checker
      • Integration is directly from translate5 Javascript to the API of the spellchecker (not proxied by translate5 server for performance reasons)
      • after typing a space character a call to the server-side spell checker is made. check is made everytime the user starts stopping typing (if the user has continued to change nothing when the result arrives, the result will be applied); when a segment is opened, the first check is requested (and also applied only if the user has not started editing in the meantime)
      • When a segment is saved after editing, the SpellCheck is started and a popup informs the user when errors have been found (refering to the segment has been closed). (cancelled)
      • also a call to the spell-checker is made when the user navigates in the segment editor, and the current version of the text was not yet checked

      Switch spell checker on, if language is provided

      Via languageTool API it is checked onTaskOpen, if languageTool supports the current target language. If yes, the server side spell checker integration is activated for this task. If no, the browser spell checker should NOT be deactivated (see below)

      Deactivation of browser spell checker

      It must be ensured, that the spell checker, which is built into the browser is deactivated, if a server side spell checker is activated. Ways to do that should be checked during the conception phase for recent Firefox, Safari, Edge and Chrome. Possible ways are listed in
      http://stackoverflow.com/questions/4524000/turn-off-chrome-safari-spell-checking-by-html-css
      http://stackoverflow.com/questions/254712/disable-spell-checking-on-html-textfields

      Serverside configuration

      • switch spell checker on or of

      Showing of graphical results

      • The result marks errors with a wave line.
      • different error types have different colors of the line (analogous to https://languagetool.org/)

      Interaction with the error markup

      In the first step will be inlcuded

      When right-clicking on the marked string (analogous to https://languagetool.org/), the tool tip will

      • show an error description
      • list alternatives (if provided in the languagetool json answer)
      • [optional, after left click:] replace the marked string with a selected alternative
      • provide an URL, that shows more information about the error type (if provided in the languagetool json answer)

      In the first step NOT included in the integration

      Since languagetool API does not support this so far, the following functionality of tool tips on https://languagetool.org/ will not be part of the first step of implementation:

      • show examples for what the error means
      • to ignore the error
      • to add the word to the dictionary
        For this functionality we later can provide a solution via translate5 API.

       

      Attachments

        Issue Links

          Activity

            People

              Ines-Paul Ines-Paul Baumann (Inactive)
              marcmittag Marc Mittag [Administrator]
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: