Update the OpenXML filter to expose the sheet name and cell reference of a Trans-unit

Issue #825 resolved
Clement Mouchet created an issue

This filter is very powerful as Excel is (unfortunately) frequently used to exchange data.

It’s common to have to do complex filtering on a cell. This issue proposes to expose the sheet name and cell reference of a trans-unit so other steps and consumers can have more context about the source of the cell.

Setting the TransUnit name

Having a meaningful resname is very useful. Many filters for key-value pair formats do, and this a powerful feature.

The proposed change will set the rename on a simple trans-unit:

<trans-unit id="P147242AB-tu1" resname="master!A1" xml:space="preserve">
<source xml:lang="en-US">cell content</source>
<target xml:lang="de-DE"></target>
</trans-unit>

But also on a sub-filtered trans-unit:

<group id="P147242AB-tu1_ssf1" resname="sub-filter:master!A1">
<trans-unit id="P147242AB-tu1_sf1_tu1" resname="master!A1_1">
<source xml:lang="en-US">sub-filtered cell content</source>
<target xml:lang="de-DE"></target>
</trans-unit>
</group>

Setting properties on the TransUnit

Setting the sheet name and cell reference as properties on the TransUnit will allow anyone to write steps that leverage those to accommodate complex requests, such as specifying character restrictions, injecting notes, etc.

I’ll create a PR shortly.

Comments (5)

  1. Clément Mouchet

    This filter is very powerful as Excel is (unfortunately) frequently used to exchange data.

    It’s common to have to do complex filtering on a cell. This issue proposes to expose the sheet name and cell reference of a trans-unit so other steps and consumers can have more context about the source of the cell.

    Setting the TransUnit name

    Having a meaningful resname is very useful. Many filters for key-value pair formats do, and this a powerful feature.

    The proposed change will set the rename on a simple trans-unit:

    <trans-unit id="P147242AB-tu1" resname="master!A1" xml:space="preserve">
    <source xml:lang="en-US">cell content</source>
    <target xml:lang="de-DE"></target>
    </trans-unit>
    

    But also on a sub-filtered trans-unit:

    <group id="P147242AB-tu1_ssf1" resname="sub-filter:master!A1">
    <trans-unit id="P147242AB-tu1_sf1_tu1" resname="master!A1_1">
    <source xml:lang="en-US">sub-filtered cell content</source>
    <target xml:lang="de-DE"></target>
    </trans-unit>
    </group>
    

    Setting properties on the TransUnit

    Setting the sheet name and cell reference as properties on the TransUnit will allow anyone to write steps that leverage those to accommodate complex requests, such as specifying character restrictions, injecting notes, etc.

    I’ll create a PR shortly.

  2. Log in to comment