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

Enable tags in InstantTranslate text field

    XMLWordPrintable

Details

    • High
    • Enable HTML Markup in InstantTranslate
    • Hide
      Instant Translate now supports using HTML markup in the text to translate. Tag-errors maybe caused by the used services (e.g. DeepL) are automatically repaired when markup is submitted. Please note, that for the time, the typed markup is incomplete or the markup is syntactically incorrect, an error hinting at the invalidity of the markup is shown.
      Show
      Instant Translate now supports using HTML markup in the text to translate. Tag-errors maybe caused by the used services (e.g. DeepL) are automatically repaired when markup is submitted. Please note, that for the time, the typed markup is incomplete or the markup is syntactically incorrect, an error hinting at the invalidity of the markup is shown.
    • -

    Description

      Currently tags are deleted from text that is pasted into InstantTranslate's text area, before the text is send to language resources for translation.

      In the future they should stay and send (converted to xliff tags) to the language resources (in the same manner, as translate5 does it in the editor).

      For performance reasons not Okapi should be used for this and to also cover syntactically incorrect HTML this should be based on Regex.

      The regex must ensure, that characters like <  and > do not cause problems, if they are not meant as tags. Rules for this could look like this:

      • < is a tag start, if it is directly followed by [A-Z,a-z] and if before a coming > there is either no space or the characters " and = occur (therefore there are HTML attributes).
      • > is a tag end, if it is preceeded by 1 or no / that is preceeded by[A-Z,a-z] and <
        Regec could be: </?[A-Z,a-z]/?>
      • > is a tag end if it is preceeded by what was defined in the first bullet
      • it must also be ensured, that an HTML comment is handled like a tag, so the complete content is returned, like it was send

       Also translate5 is since a few months able to repair tag errors produced by DeepL (closing tag before starting one, missing tag of paired tag).

      To support the tag syntax repair of translate5 it must be ensured, that opening tags are converted to opening g-tags for translation (or bx-tags - please check with tlauria ), closing ones to closing g-tags (or ex-tags) and stand-alone tags to x-tags.

      Attachments

        Issue Links

          Activity

            People

              axelbecher Axel Becher
              marcmittag Marc Mittag [Administrator]
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: