Skip Navigation

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Sun Mon Tue Wed Thu Fri Sat
9:00 – 15:00 9:00 – 15:00 9:00 – 15:00 9:00 – 15:00 9:00 – 15:00 - -
- - - - - - -

Supporter timezone: Asia/Yerevan (GMT+04:00)

Tagged: 

This topic contains 0 replies, has 0 voices.

Last updated by Christopher Amirian 1 hour, 46 minutes ago.

Assisted by: Christopher Amirian.

Author Posts
February 4, 2025 at 9:23 am

julienD-52

Background of the issue:
I have a website using the Rehub theme and WooCommerce. The issue concerns the translation of 'comparison table' modules. A representative example is the 'Yuh vs Revolut' comparison page located at: hidden link

Symptoms:
At the top of these comparison pages, there is a 'Comparison table.' This table does not translate from the original French version to other languages (e.g., English). The content within the comparison table remains in French even when viewing the translated page. The content of the Comparison table does not appear in the WPML Advanced Translation Editor, preventing me from manually translating it.

I have attached screenshots showing the English version of the page with the French text still present in the comparison table, as well as a screenshot of the WPML Advanced Translation Editor where the comparison table content is missing.

Questions:
How can I get these Comparison tables to be translated by WPML into the different languages used on my website?

February 4, 2025 at 10:07 am
February 4, 2025 at 10:09 am #16665905

Christopher Amirian
Supporter

Languages: English (English )

Timezone: Asia/Yerevan (GMT+04:00)

Hi,

My suggestion is to add the code below to WP Dashboard > WPML > Settings > XML Configuration (tab):

<wpml-config>
  <gutenberg-blocks>
    <!-- Configuration for the main comparison table block -->
    <gutenberg-block type="rehub/comparison-table" translate="1">
      <key name="bottomTitle" />
      <key name="prosTitle" />
      <key name="consTitle" />
      <key name="specTitle" />
    </gutenberg-block>

    <!-- Configuration for the comparison item sub-block -->
    <gutenberg-block type="rehub/comparison-item" translate="1">
      <key name="productTitle" />
      <key name="productSubtitle" />
      <key name="numberValue" />
      <key name="starRating" />
      <key name="bottomText" />
      <key name="prosText" />
      <key name="consText" />
      <key name="specText" />
      <key name="listTitle" />
      <key name="listItems">
        <key name="key" />
      </key>
    </gutenberg-block>
    <gutenberg-block type="rehub/review-heading" translate="1">
      <key name="title"></key>
      <key name="subtitle"></key>
    </gutenberg-block>    
  </gutenberg-blocks>
</wpml-config>

That should make the Rehub theme Comparison Table block compatible with WPML.

To see the result of the change you need to do as follows:

- Go to your Dashboard > Pages.
- Open the edit screen of the original page. You should see a pencil/circle/gear icon in the sidebar options under the "Languages" section.
- Make a small change, for example, add an extra blank space at the end of a sentence/paragraph.
- Save it.
- You should now see that a circular arrow appears beside the 2nd languages links, this means that an update is required.
- Edit the translation again and save it up to 100% translated.

I'd appreciate it if you get back to us with the result.

Just FYI, I used this method to find the code:

https://wpml.org/documentation/support/language-configuration-files/make-custom-gutenberg-blocks-translatable/

Thanks.

February 4, 2025 at 10:45 am #16666151

julienD-52

Hi, so our developer added the code. It works except for the items ("key" I think they are called) in yellow in the attached printscreen. Is there an extra line of code to add for these?

2025-02-04 11_42_01-Yuh vs. Revolut – the comparison in 8 key points (February 2025) _ heyneo.ch and.jpg
February 4, 2025 at 12:47 pm #16666698

Christopher Amirian
Supporter

Languages: English (English )

Timezone: Asia/Yerevan (GMT+04:00)

Hi,

I'm glad that most of the items worked. I changed the code to have * instead of key to have all the sub items and it worked:

<wpml-config>
  <gutenberg-blocks>
    <!-- Configuration for the main comparison table block -->
    <gutenberg-block type="rehub/comparison-table" translate="1">
      <key name="bottomTitle" />
      <key name="prosTitle" />
      <key name="consTitle" />
      <key name="specTitle" />
    </gutenberg-block>
    <!-- Configuration for the comparison item sub-block -->
    <gutenberg-block type="rehub/comparison-item" translate="1">
      <key name="productTitle" />
      <key name="productSubtitle" />
      <key name="numberValue" />
      <key name="starRating" />
      <key name="bottomText" />
      <key name="prosText" />
      <key name="consText" />
      <key name="specText" />
      <key name="listTitle" />
      <key name="listItems">
        <key name="*" />
      </key>
    </gutenberg-block>
    <gutenberg-block type="rehub/review-heading" translate="1">
      <key name="title"></key>
      <key name="subtitle"></key>
    </gutenberg-block>
  </gutenberg-blocks>
</wpml-config>

I tested on the page below and it seems to be working ok:

hidden link