In Progress

WPML duplicate translation strings in Icon List block (greenshift-blocks/iconlist)

2

Hi GreenShift team,

We are experiencing duplicate strings in WPML’s Advanced Translation Editor for the GreenShift Icon List block.

I found the existing report titled “WPML String Translation registers duplicate translatable strings for greenshift-blocks/text, /heading, /button(box).” This appears to be a related issue affecting another block.

WPML support investigated our site and identified the following configuration as the cause:

<gutenberg-block
    type="greenshift-blocks/iconlist" translate="1" label="Advanced List">
    <xpath>//*[contains(@class, 'gspb_iconsList')]</xpath>
    <key name="iconsList">
        <key name="*">
            <key name="content" />
        </key>
    </key>
</gutenberg-block>

According to their investigation, the XPath matches both parent and nested elements whose classes contain gspb_iconsList. The same text is therefore extracted multiple times, and ATE displays duplicate translation segments after stripping the HTML.

Our page contains many Icon List blocks. WPML found that the generated XLIFF file was approximately 2.3 MB and suggested that the duplicates may contribute to slow processing and connection timeouts.

As a temporary workaround, WPML recommended narrowing the XPath to:

<xpath>//span[contains(@class, 'gspb_iconsList')]</xpath>

We have applied this through WPML → Settings → Custom XML Configuration and resent the page for translation. We are awaiting confirmation from our translator that the duplicates are resolved.

Could you please review the Icon List translation configuration and include a permanent fix? Please also confirm whether this block was covered by the fix discussed in the earlier report, or whether it requires a separate update.

Thank you,
Andrea

Andrea Baldovic

⏱

Replies

Responses

  1. support_angel Avatar
    support_angel
    Support

    Thanks, and thanks to WPML support for the analysis. The Icon List wasn’t covered by the earlier fix, so it needed a separate one. In GreenShift 13.2.3 the Icon List XPath only matches the item text (//span[contains(@class, 'gspb_iconsList__item__text')]), so each item is registered once. The iconsList > content key stays, so translated lists still validate in the editor.

    After updating you can remove your custom XML configuration, then resend the page for translation so the new configuration is used.

    1. Andrea Baldovic Avatar
      Andrea Baldovic
      Member

      Great, thank you!

Post a Reply