Skip to content Skip to sidebar

This thread is resolved. Here is a description of the problem and solution.

Problem:
If you're experiencing an issue where the title of an accordion made with the 'Accordion Toggle' plugin is not being translated on your product pages, even though it appears translated in the translation editor, we can help.
Solution:
To resolve this, you need to register the block for translation:
1. Navigate to WPML-> Settings-> Custom XML Configuration.
2. Insert the following code:

<wpml-config><br />  <gutenberg-blocks><br />    <gutenberg-block type="accordion-toggle/accordion-item" translate="1"><br />        <xpath>//p</xpath><br />        <xpath>//h3</xpath><br />    </gutenberg-block><br />  </gutenberg-blocks><br /></wpml-config>

3. Click 'Save'.
4. Edit the page in the default language.
5. Make a minor edit and then update it.
6. Update the translation.
After following these steps, check your translated product page to see if the title is now correctly translated. For more detailed guidance, please refer to our documentation on making custom Gutenberg blocks translatable.

If this solution doesn't look relevant to your issue, please open a new support ticket with us.

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.

This topic contains 3 replies, has 2 voices.

Last updated by Osama Mersal 1 year, 8 months ago.

Assisted by: Osama Mersal.

Author Posts
January 21, 2024 at 11:24 am #15208146

mathisT

Hello,

I used the automatic translation feature on my website and it worked well. The problem is that on my product pages, I have accordion mades with this plugin :

https://wordpress.org/plugins/accordion-toggle/

The content of the toggle is translated on the product page but the title is not the translated one. It's weird because in the translation editor, the title is shown and translated correctly.

The translation of the title is just not showing one the real product page.

Could you help me please ?

Thank you

January 21, 2024 at 12:58 pm #15208336

Osama Mersal
WPML Supporter since 02/2020

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+03:00)

Hi,

Thanks for contacting WPML forums support. I'll be glad to help you today.

1) Please login to this sandbox site and install the according plugin. (hidden link)

After that, please create a test accordion tab and translate it to replicate the issue. If the issue is replicable, please let me know the steps to reproduce it.

2) Could you please share your Debug information with me?
You can read a detailed explanation about it here. (http://wpml.org/faq/provide-debug-information-faster-support)
The debug info will give me a lot of information about how your site is configured.

Best regards,
Osama

January 21, 2024 at 3:20 pm #15208549

mathisT

Hello,

Thank you for your fast reply.

I installed the plugin on your test website. The accordion is on th home page : hidden link

As you can see, if you change the language, the accordion content language is changing but the title isn't.

I guess it's a simple issue but i can't solve it.

January 21, 2024 at 3:42 pm #15208672

Osama Mersal
WPML Supporter since 02/2020

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+03:00)

Hi,

Thanks for replicating the issue. I was able to fix the issue by registering the block for translation. Kindly check the following steps:

1- Go to WPML-> Settings-> Custom XML tab
2- Add the following code

<wpml-config>
  <gutenberg-blocks>
    <gutenberg-block type="accordion-toggle/accordion-item" translate="1">
        <xpath>//p</xpath>
        <xpath>//h3</xpath>
    </gutenberg-block>
  </gutenberg-blocks>
</wpml-config>

3- Click Save
4- Edit the page in the default language
5- Make a minor edit and update it
6- Update the translation

Kindly check the translated shop page and let me know if it works correctly. (hidden link)

Please check the following guide about registering custom blocks. (https://wpml.org/documentation/support/language-configuration-files/make-custom-gutenberg-blocks-translatable/)

Best regards,
Osama