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

Merge and split segments

    XMLWordPrintable

Details

    • Medium
    • -

    Description

      Caution: Should need to be possible to disable the feature

      General description

      It should be possible for the editing person to merge and split segments in translate5 editor.

      This means to make 1 segment from 2 (merge them) or to make 2 segments  from one (split them).

      As usual in all translation tools merging or splitting of segments can only be done within one trans-unit of an xliff file.

      File type scope

      To minimize the effort the scope will be narrowed to xliff 1.2 and sdlxliff. That means of course also everything coming through the Okapi integration and the Across integration (for Across it should be checked, if Across is able to handle a changed number of segments inside a trans-unit on import). For CSV and Star Transit splitting and merging of segments will not be supported.

      GUI implementation

      Splitting

      For splitting segments a new button is added to the segment actions as shown in the screen.

      It is only active, if in both, source and target text, a text is selected.

      The following screen shows both.

      If the selected text in source and/or target is in the middle of the current segment (meaning that there is text left AND right of the selection) the segment will be split in 3 new segments - otherwise only in 2.

      Before the splitting is done, a warning pop-up will be displayed first: "This segment will be split in the following new segments." (a listing of the two or three new segments follows).

      In case the source or target of a segment contains a marker, that the source or target is empty because there had been an uneven number of segments in the corresponding trans-unit, splitting of this segment is not possible. A message communicates this to the user, if he tries it and tells him first to merge this segment with another one to get rid of the empty part and afterwards split it.

       Merging

      A new button "Merge segments" is introduced as shown in the screen.

      It is only active, if at least 2 segments that directly follow each other are selected AND if all of these segments belong to the same trans-unit in the original XLIFF file.

      The button shows the following tooltip: "Please select at least 2 lines that follow each other directly. Do that by clicking on a row and then press CTRL and click at the next row."

      Currently the segment grid only allows to select 1 row simultanously. This must be changed and possible interactions with other  features must be checked.

      In case the source or target of one or multilple of the merged segments contains a marker, that the source or target is empty because there had been an uneven number of segments in the corresponding trans-unit, these markers are removed on merging if after the merge there is content in the source/target.

      Consequences of the implementation

      The implementation is quite complex because a number of essential parts of translate5's backend need to be changed:

      • How the import extracts segments
      • How the export handles segments
      • How segment numbering is done
      • How segment sorting is done

      The front-end implementation is the easiest part.

      As a consequence (and for better usability in the front-end) the segment numbering will be changed: After implementation the segment numbering will show 2 numbers separated by a dot. The first number is corresponds to the trans-unit-number of the segment. The second number corresponds to the segment number inside that trans-unit.

      For example:

      The first trans-unit contains only one segment. Its numbering thus looks like "1.1". The second segment belongs to the next trans-unit and its numbering looks like "2.1".

      After the first segment has been split into 2 segments, the first of these segments still looks like "1.1" and the second looks like "1.2". The now third segment then still looks like "2.1".

      This also shows very clearly to a user, which segments can be merged: Only those with the same number before the dot.

      Attachments

        Issue Links

          Activity

            People

              aleksandar Aleksandar Mitrev
              marcmittag Marc Mittag [Administrator]
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: