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

Whitespace import in XLF documents

    XMLWordPrintable

Details

    • Task
    • Resolution: Fixed
    • None
    • None
    • None

    Description

      According to the xliff spec, the attribute "xml:space" defines how to deal with whitespace inside of tags. There are two values: "default" → this means the application (translate5) can do with the whitespace what ever we want and "preserve" where the white space should be preserved. If the attribute is missing "default" is the default.

      Regarding different real live XLF files I got to the following conclusion:

      • Okapi XLF makes use of the flag
      • OpenTM2 XLF: does not make use of the flag as far as I can see
      • Our customers XML files containing XLF: No xml:space attribute is given, but analyzing the content led me to the assumption that it would be better to ignore the whitespace:
        <trans-unit id="1344-19-1">
            <source>
                <g [style info...]>Text refering to the following chinese name</g>
                <g [different style info...]>[CHINESE NAME]</g>
                <g [style info...]>.</g>
            </source>
        </trans-unit>
        

      Looking at this content, it would be correct in my opinion to ignore the whitespace in the translate5 import since it is only to format the XML here and has absolutely no semantic for the users content. Indeed the whitespace produces eight additional tags plus the six needed tags.
      For XLF import the xml:space should be respected. "preserve" is the current default, and should stay for CSV and SDLXLIFF import.

      A new boolean Zf_configuration config "preserve all whitespace" is created.
      If it is set to yes, all whitespace is preserved by using internal tags (current behaviour).
      If it is set to no: All whitespace is ignored, expect a xml:space=preserve attribute was given in the current node or its parent node.

      Attachments

        Issue Links

          Activity

            People

              tlauria Thomas Lauria
              tlauria Thomas Lauria
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: