Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Optionally do definitions in xliff 1.2
  2. Define
    1. task-template.xml
    2. pixel-mapping.xlsx (only if pixel-length check)
  3. Use ZIP import package and include include task-template.xml and optionally pixel-mapping.xlsx

More in detail

For length restrictions to be used in any case a task-template (task-template.xml) has to be provided for a task and length restrictions have to be activated there for the task (details see below).

For pixel-based length restrictions to work some default settings also have to be provided in the Zf_configuration database table (system configuration; see below). Also the pixel-width definitions have to be provided as an Excel file (pixel-mapping.xml ) that is fed alongside the task-template to the import zip for the task.

...

  • size-unit
    • If the length check should be character-length based or pixel-length based
    • Possible values:
      • pixel
      • char
  • minLength
    • Minimum length in number of pixel / characters
    • Refers to the length of a complete trans-unit of an xliff file, even if it spans multiple segments.
    • This means for min-length set in a task template for let's say a word document, that the length restriction refers to a whole paragraph.
    • If maxNumberOfLines is set, minLength is not supported so far (ask translate5's development team, if you need it)
  • maxLength
    • Maximum length in number of pixel / characters
    • Refers to the length of a complete trans-unit of an xliff file, even if it spans multiple segments.
    • This means for maxLength set in a task template for let's say a word document, that the length restriction refers to a whole paragraph.
    • If maxNumberOfLines is set, maxLength refers to the length of each line, otherwise maxLength refers to the trans-unit
  • translate5:maxNumberOfLines
    • How many lines a segment (not a trans-unit) should maximally have
    • If maxNumberOfLines is set,
      • maxLength refers to the length of each line, otherwise maxLength refers to the trans-unit
      • minLength is not supported so far (ask translate5's development team, if you need it)
  • For pixel-based length check:
    • For each character for a certain font and a certain font-size the assumed pixel-width
    • What fontFont-size and what font should be assumed for the current task
      • Definitions in task-template.xml
      • Would be possible to overwrite them in xliff 1.2, yet this is not yet implemented (ask translate5s development team, if you need it)

Task template definitions

For length restrictions to be activated, in any case a task template has to be used.

The <lengthRestriction></lengthRestriction> tag has to be present in the task template and the task template has to be provided to the imported zip package.

...

Special settings for pixel length restriction

For this pixel-based length check to work somewhere the pixel length of each character of a used font in the used font-size has to be defined.:For this definitions

  • in translate5s system

...

...

System configuration in Zf_configuration for pixel length restriction

...

The pixel-mapping.xlsx file has to be provided within the ZIP import package (please go here for more information on the zip package format).

Please find an example for pixel-mapping.xlsx below.

...

Example pixel-mapping.xlsx file
View file
namepixel-mapping.xlsx
height250

Definitions in xliff 1.2

(overwrite corresponding

...

definitions in task template)

Please see "Definable parameters" for explanation.

Example:

    <trans-unit id="4" translate5:maxNumberOfLines="2" minwidth="100" maxwidth="300" size-unit="pixel">
    
<source>Example for maximal 2 lines, minwidth 100, maxWidth 300.</source>
    
<target></target>
    
</trans-unit>

...