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

Placeables in translate5

    XMLWordPrintable

Details

    • Medium
    • Added capabilities to identify Placeables in xliff-tags. Placeables are single internal tags that will be shown with their text-content instead as tag. For identification XPaths have to be defined in the configuration.
    • -

    Description

      Add Placeables to translate5. Placeables are xliff-tags in the input-stream, that represent a certain word/phrase in the segment that should not be edited by the users/translators. These placeables can be detected e.g. by an attribute.

      a) Detection:
      all Paceables will be internal tags anyway so we detect them in the unescaped content of a internal tag in the import process. To detect we use an array of XPathes stored in the Configuration. The XPathes are seen relative to the tag-content as root (not the document):

      [
          "//div[contains(@id, 'foo')]/a/@title",
          ...
      ]
      

      When an internal tag is identified as placeable, it will marked with an additional class "t5placeable" and the referenced content is stored in a data-property: data-t5content="something"

      b) Processing/usage:
      In the realm of the visual segmentation such internal tags are replaced with their escaped content, as well during segmentation to identify complete segments and also in the frontend when rendering.
      When pretranslating with a MT these tags might be wrapped with an marker-tag (to re-identify them in the content after MT-translation & replace with the original) to have them as translation-context (instead of a "dead" internal tag)
      When we do the refactoring of the internal tags / div-span, we could easily create rules that Placeables are always shown "expanded" even in the short view

      c) Challenges/ questions
      Problematic can be contents, that themselves represent markup. The rule would be to strip Placeables of all markup but <b>, <i>, <u>, <strong>, <sup>, <sub> and remove all potential attributes in these tags

      Attachments

        Activity

          People

            axelbecher Axel Becher
            axelbecher Axel Becher
            Leon Kiz
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: