Skip to content Skip to sidebar

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
10:00 – 14:00 10:00 – 14:00 10:00 – 14:00 10:00 – 14:00 10:00 – 14:00 - -
16:00 – 20:00 16:00 – 20:00 16:00 – 20:00 16:00 – 20:00 16:00 – 20:00 - -

Supporter timezone: Asia/Jerusalem (GMT+02:00)

Tagged: 

This topic contains 8 replies, has 0 voices.

Last updated by Itamar 3 months, 2 weeks ago.

Assisted by: Itamar.

Author Posts
August 12, 2025 at 11:06 pm #17315142

jefferyT-3

<b>Background of the issue: </b>
I have sidebars/widget areas in my theme where I added Widget Group blocks and then translated the blocks. The issue can be seen on this page: hidden link.

REST API is enabled (I checked by viewing hidden link) - I don't know why WPML reports it as disabled. (I also see this issue in a production site that WPML reports the REST API as enabled.)

<b>Edit:</b> WPML > Support now reports the REST API as enabled.

<b>Symptoms: </b>
Widget Group titles are displayed in the original language instead of the translated language, although the Widget Group block content is displayed correctly.

In the screenshots you can see:
1. How each sidebar is registered with the default or a custom before_title value
2. Each widget area has one Widget Group block
3. Translations are entered in the translation editor
4. String translations for block widgets
5. With the translation of one Widget Block title opened
6. English page (each widget title class has a different background color assigned)
7. Chinese page, where the English titles are displayed and not the translated ones

<b>Questions: </b>
Why are the Widget Group titles not displaying in the translated language?
How can I ensure that the Widget Group titles are translated correctly?

Looking at the string translations, two things stand out to me:
1. No matter what before_title value was used when registering the sidebar, the string value has '<h2 class="widget-title">' instead. (When before_title is not set, the default h2 class name is "widgettitle".)
2. The inner blocks div is closed, i.e. has a </div> tag.

August 14, 2025 at 9:01 am #17320208

Itamar
WPML Supporter since 02/2016

Languages: English (English )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi,

Thanks for reporting this issue.

If you need further help with this, please share the access details to your site with me. I'm enabling a private message for the following reply.

Privacy and Security Policy
We have strict policies regarding privacy and access to your information. Please see:
https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/
**IMPORTANT**
- - Please backup the site files and database before providing us access. --
-- If you have a staging site where the problem can be reproduced, it is better to share access to the staging site.--

Otherwise, please allow me to take a copy of your site. For this, I must install a plugin like Duplicator or All In One Migration. Please let me know if you agree.

Regards,
Itamar.

August 18, 2025 at 3:59 pm #17328597

Itamar
WPML Supporter since 02/2016

Languages: English (English )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi, and thanks for the access details.

I was able to fix this issue on your site.

1. In WPML -> Strings Translation -> Admin Text Translation screen, I search for those widgets. In my search, I used "before_title" because it shows in all your widgets.

This is the direct link to this section on your site:
hidden link

You can read about finding strings that don't show in Strings Translation here:
https://wpml.org/documentation/getting-started-guide/string-translation/finding-strings-that-dont-appear-on-the-string-translation-page/#register-admin-and-setting-strings-for-translation

2. I selected the widget strings and clicked the button "Add to Strings Translation". Please see the attached screenshot add-to-st.jpg.

3. Then, in Strings Translation, I translated those strings. You need to pay attention to what to translate inside those strings. Please see the attached screenshot translate-widget-in-st.jpg.

Now, on the frontend, you will see that the problem is fixed. Please see the attached screenshot, fixed-problem.jpg.

I know this is not an ideal solution, so I'm consulting our second-tier supporters to see if we can improve it.

Regards,
Itamar.

add-to-st.jpg
translate-widget-in-st.jpg
fixed-problem.jpg
August 18, 2025 at 4:26 pm #17328816

Itamar
WPML Supporter since 02/2016

Languages: English (English )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi,

In addition to the above, an easier solution might be to add a title with a Heading block instead of through the Widget Group title.

Regards,
Itamar.

August 18, 2025 at 9:41 pm #17329507

jefferyT-3

Hi Itamar - thanks for investigating this issue.

I initially discovered this issue after building a custom theme for a client. I reproduced the issue on a separate, simpler site just for this bug report.

I'm sure the procedure you outlined works, but I can't ask my (non-technical) client to repeat it when they need to change the original and/or translated text, not for a plugin they are paying for.

Due to site design requirements, the Heading block is not a viable workaround (the custom theme needs the HTML structure and class names of the Widget Group block to do some specific styling).

Since the Widget Group block is a built-in, default WordPress block, I would expect WPML to be fully compatible with it.

I hope there can be a better solution for this issue - thanks again for your help.

August 19, 2025 at 7:28 am #17329849

Itamar
WPML Supporter since 02/2016

Languages: English (English )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi,

Our second-tier supporter has reproduced this issue. If needed, he will esclate this issue to our developers. And before that, if possible, he will share a workaround. I'll keep you updated on any news regarding this issue.

I appreciate your patience.
Itamar.

August 19, 2025 at 11:52 am #17331021

Itamar
WPML Supporter since 02/2016

Languages: English (English )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi,

Our second-tier supporter provided the following solution.

1. Go to WPML -> Settings -> Custom XML Configuration (tab).

2. If the field is empty, paste the XML code in it:

<wpml-config>
  <gutenberg-blocks>
    <gutenberg-block type="core/widget-group" translate="1">
      <key name="title"></key>
      <xpath>//h2</xpath>
    </gutenberg-block>
  </gutenberg-blocks>
</wpml-config>

If the field is not empty, then just paste the relevant part within the <wpml-config></wpml-config> tags.

3. Click the Save button.

4. Go to WPML -> Translation Management and look for the Block section.

5. Select the relevant Widget and send it for translation. Please see the attached screenshot blocks-in-tm.jpg.

I tried it on your test site and it works. Please see the attached screenshot, ok-on-site.jpg.

Can you please confirm this fix?

Regards,
Itamar.

blocks-in-tm.jpg
ok-on-site.jpg
August 19, 2025 at 9:28 pm #17332836

jefferyT-3

Yes, this fix works for me - I hope this can be incorporated into future versions of WPML.

Thanks again for your help.

August 25, 2025 at 2:39 pm #17345556

Itamar
WPML Supporter since 02/2016

Languages: English (English )

Timezone: Asia/Jerusalem (GMT+02:00)

Great, I'm glad that it works!

Yes, it will be incorporated into future versions of WPML.
We'll keep you updated.

Regards,
Itamar.