Modifying common (bold, underline, itailic) inline code "ctype attributes" should change the underlying format on merge

Issue #1186 open
Oscar Berg created an issue

We should allow changing basic inline formatting without the user needing to know the details of the format. We should also support adding and deleting codes.

Example Use Case:

When using Tikal to extract and merge a docx the result does not match our expectations after modifying the <g> tags and ctype attributes inside them. I am very well aware that our expected results might not match reality…

Way to reproduce:

  1. Create an xliff using tikal extract (using the provided example docx)
./tikal.sh -x simple_styled_doc.docx -codeattrs -seg

2. Manually edit the extracted xlf (Se different test scenarios below)

3. Use tikal merge to merge back to original

./tikal.sh -m simple_styled_doc.docx.xlf -od out

Test 1: Modify a <g> ctype attribute from “x-italic” to “x-bold”

Result 1: Not as expected. Tikal merge executes without error but the text inside the <g> tag is still italic in the exported original

Expected result 1: The text with style italic should be bold in the exported orginal

Test 2: Add a new <g> tag with ctype style, and id incremented

Result 2: Not as expected. Tikal merge fails to execute as the new <g> is not matched in the original. Same result if the <g> id attribute is omitted.

Expected result 2: New <g> tags (i.e. <g> tags that does not exist in the source) should be accepted and handled by default

Test 3: Remove a <g> tag in a target TU segment

Result 3: As expected. Tikal merge works as expected and the merged docx has the style removed

Test environment: Ubuntu 18 LTS, okapi release v1.44.0

Was not sure if this is to be considered a bug, so there is also a question in the google group on the topic, where I was encouraged to create an issue: https://groups.google.com/g/okapi-users/c/KDj8QRnfruo

Kind regards,

Oscar

Comments (5)

  1. jhargrave-straker

    Oscar, as you suspected changing the ctype does not affect the styling of the inline code. ctype is basically read-only for the user info or workbench to render. Adding a code is something we want to support but it’s difficult and format specific. I am going to convert this ticket to an enhancement because what you are trying to do should be supported IMHO.

    I mentioned that g/x tags were deprecated. In the upcoming version of Okapi (1.45.0) the applications now default to non-simplified xliff tags. For example, instead of g codes you will see bpt/ept codes and instead of x codes you will see ph codes. You can override this behavior in the apps options - but we don’t recommend it as the non-simplified codes provide much more information (though more verbose).

    BTW: In some formats like HTML changing the content in between the bpt and ept tags should also update the merged formatting (basically your first use case). This is much more difficult for docx/OpenXml as the inline formatting can get very complicated.

  2. jhargrave-straker

    This is a feature that SDL partially supports. It would be a great feature to support basic bold/italic/underline etc.. for various formats. Also adding deleting codes should finally be fully tested and supported.

  3. Oscar Berg reporter

    Many thanks Jim for taking the time, I can imagine the added complexity of dealing with so many different file formats.

    As the OpenXML filter(?) seems to handle the removal of tags we where hoping that the addition, and modification wasnt so far way.

    I will follow this with great interest. Sadly my Java experience is limited and work wise I am not in a position to decide my own time spent, but let me know if you think there is a way for me to help make it happen.

    Br, Oscar

  4. Log in to comment