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 24 replies, has 2 voices.

Last updated by evaH-6 5 months, 1 week ago.

Assigned support staff: Alejandro.

Author Posts
January 23, 2019 at 10:05 am #3119791

evaH-6

Tell us what you are trying to do?
Translation a page from Dutch to English. While translating, it shows the block inside of a WYSIWYG editor, which will result in a broken block after translation.

Is there any documentation that you are following?
No

Is there a similar example that we can see?
No

What is the link to your site?
hidden link

January 23, 2019 at 10:49 am #3120095

Alejandro
Supporter

Languages: English (English ) Spanish (Español ) Italian (Italiano )

Timezone: Europe/Rome (GMT+02:00)

Hello!
Welcome to WPML Support.
I'll do my best to help you solve this issue.

Gutenberg blocks are still pretty new and there are cases that haven't been registered for translation yet.

We have a small guide for registering these blocks and i suggest you take a look at it:
https://wpml.org/documentation/support/language-configuration-files/#gutenberg-blocks

If you have doubts or questions about this process, just ask me and i'll do my best to answer you as clear as possible.

Regards,
Alejandro.

February 15, 2019 at 9:18 am #3203652

evaH-6

We've added the wpml-config.xml file to our plugin directory, but unfortunately nothing is showing up while translating the page. Contents of the file:

<wpml-config>
    <gutenberg-blocks>
        <gutenberg-block type="il-fiore/daypass" translate="1">
            <xpath>//section/div/div/div/form/div/fieldset/legend</xpath>
            <xpath>//section/div/div/div/form/div/fieldset/label</xpath>
            <xpath>//section/div/div/div/form/button</xpath>
        </gutenberg-block>
    </gutenberg-blocks>
</wpml-config>

Is there anything else we need to do?

February 18, 2019 at 7:53 am #3210417

evaH-6

Can we get a reply to this? Currently on top of this I get the recommendation to use chat because the support queue is calm, but this issue doesn't have an answer for 3 days.

February 18, 2019 at 2:45 pm #3212772

Alejandro
Supporter

Languages: English (English ) Spanish (Español ) Italian (Italiano )

Timezone: Europe/Rome (GMT+02:00)

Hello,

Sorry for the delay in the answer.
The problem is that the blocks are not being registered correctly. you can follow this guide to know how to correctly register them:

https://wpml.org/documentation/support/language-configuration-files/#gutenberg-blocks

i could also help you with this if you can't get around the problem. I would just need access to your site and a page where i can see the blocks and i'll check them out and register them for you.

Please know,though, that even though there shouldn't be a problem registering them, some custom block might not work as expected and this is due the fact that gutenberg support is still very new, but i can definitely give it a try and see how it goes.

Let me know and once again i'm deeply sorry for the late reply (the last reply of the ticket ticket was very old and i couldn't see it in my queue until today, plus i don't work on weekends).

February 19, 2019 at 1:51 pm #3216930

evaH-6

How would I register them myself, and does this not happen when we create our blocks? This is of course an issue that will happen more often in new websites.

We're using create-guten-block in our plugin to create the blocks: hidden link

February 20, 2019 at 10:26 am #3220808

Alejandro
Supporter

Languages: English (English ) Spanish (Español ) Italian (Italiano )

Timezone: Europe/Rome (GMT+02:00)

Hi Eva, the answer is yes and no.

You see almost each block has a different structure and they need to be registered because if the structure hasn't been registered by us and the structure is different than the one we have registered, then the system won't know what info to get for translation.

Registering them is actually easier than it looks, i suggest you give it a try by checking out the link i sent you. it has the sctructure you need to follow.

The code can be written directly in WPML > Settings > Custom XML Configuration. Our editor even has a syntax helper and will verify the structure before validating it so you'll know if there are errors.

I can help you along the way if you get stuck, but what you're doing is a bit beyond the scope of our support yet we can always give you a hand and point you in the right direction.

Let me know how it goes.

February 22, 2019 at 9:44 am #3231621

evaH-6

I'm not sure how to register the block. If I understand this correctly, the following code does not register them?

<wpml-config>
    <gutenberg-blocks>
        <gutenberg-block type="il-fiore/daypass" translate="1">
            <xpath>//section/div/div/div/form/div/fieldset/legend</xpath>
            <xpath>//section/div/div/div/form/div/fieldset/label</xpath>
            <xpath>//section/div/div/div/form/button</xpath>
        </gutenberg-block>
    </gutenberg-blocks>
</wpml-config>

However, I don't see any other way in the documentation to do this.

February 25, 2019 at 4:45 pm #3241180

Alejandro
Supporter

Languages: English (English ) Spanish (Español ) Italian (Italiano )

Timezone: Europe/Rome (GMT+02:00)

Could you give me access to your site and indicate where can i find that block? i'd like to look a it in order to tell you if that code is correct or not and determine how to proceed from here.

I activated the related fields. They are privae and only you and i will be able to access them.

Regards.

March 1, 2019 at 1:59 pm #3261320

evaH-6

The IP has been added to our firewall. You should be able to access our acceptance environment now.

March 5, 2019 at 4:42 pm #3275264

Alejandro
Supporter

Languages: English (English ) Spanish (Español ) Italian (Italiano )

Timezone: Europe/Rome (GMT+02:00)

Hi, i checked your site and i couldn't find where did you add the gutenberg blocks, or where did you create them, could you please point me in the right direction?

Thanks.

March 6, 2019 at 8:50 am #3277499

evaH-6

The gutenberg blocks are created in a plugin, and added to all pages. Could I upload a zip here so I can send you the plugin code? (This code is private of course)

March 6, 2019 at 3:58 pm #3280185

Alejandro
Supporter

Languages: English (English ) Spanish (Español ) Italian (Italiano )

Timezone: Europe/Rome (GMT+02:00)

Yes, please do, and if you can document me the process so i can replicate it later, that would be excellent really, that way i'll be able to make all my tests.

your next reply will be private. please add it in one of the fields i activated for you, if they are too big, then just send me a dropbox, drive or any other storage platform link you want and i'll take it from there.

Thanks in advance.

March 9, 2019 at 2:09 pm #3298404

Alejandro
Supporter

Languages: English (English ) Spanish (Español ) Italian (Italiano )

Timezone: Europe/Rome (GMT+02:00)

Hello. i tried to translate one of the and it's not really translating as it should so i'm trying to find the best way to translate your block.

i couldn't find the "daypass" block, though so i was trying with USP.

in your code however there was something missing but i'm not sure ow correct this is (yet, until i can test the daypass block)

the type at the beginning of the code should look like:

 type="core/il-fiore/daypass" 

so try adding "core" to it and see if that fixes the daypass code. it will certainly show it in the editor (otherwise it won't show it).

Let me know how it goes.

March 13, 2019 at 2:51 pm #3335111

evaH-6

The blocks do not need to be prefixed with 'core'. You can find the blocks under 'Il Fiore Blokken' as seen in the picture.

As you can see in this example project by WordPress, the blocks don't have to start with 'core'. Or does WPML filter on this to make them translatable?

hidden link