GTranslate works unexpectedly with Spectra’s “Table of contents” block.

[ad_1]

Plugin Author
edo888

(@edo888)

Hi,

Please post your website address, otherwise I will not be able to help you.

Thanks! 🙂

Thread Starter
jpgoem

(@jpgoem)

Hi @edo888,

You can access a localWP test site :

Open Live Link:

If prompted, enter the information below.

Username: mineral

Password: practical

Plugin Author
edo888

(@edo888)

Hi,

I see that the Table of Contents plugin is adding some HTML tags with anchor IDs in /wp-content/plugins/ultimate-addons-for-gutenberg/assets/js/table-of-contents.min.js file based on content text.

Looks like when the heading text inside h2 gets translated, it is being confused, since anchor ID and text inside the h2 tag no longer match. For example you have #second-heading link and <h2>Second Heading</h2>, when translated into French the h2 changes and becomes <h2>deuxième titre</h2>, so second-heading does not match with deuxième titre.

I do not know a quick solution for you. I can only suggest to change the logic to not depend on text (which can be not what you expect after translation) or possibly do the code modifications server side via PHP and not later via javascript.

Thanks! 🙂

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer