Skip Navigation

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

Problem:
The client needed assistance with making Gutenberg patterns translatable in WPML, as the provided documentation did not seem to apply directly to patterns.

Solution:
1. We advised the client to refer to the documentation on translating reusable blocks, as the process is similar: Translating Reusable Blocks.

2. We provided an example of how to register a pattern in the WPML settings using Custom XML Configuration. Here is the XML code to use:

<wpml-config>
  <gutenberg-blocks>
    <gutenberg-block type="core/block" translate="1">
        <key name="content">
          <key name="0ueX75">
          <key name="values">
            <key name="content" />
            </key>
          </key>
          <key name="0lskp4">
          <key name="values">
            <key name="content" />
            </key>
          </key>
      </key>
    </gutenberg-block>
  </gutenberg-blocks>
</wpml-config>

3. After applying the XML configuration, the client should be able to translate the pattern in the Advanced Translation Editor (ATE).

4. We clarified that since a pattern is a collection of blocks, it may already be recognized by WPML. However, the pattern itself needs to be registered as a block with WPML.

5. We also recommended revisiting the guide on making custom Gutenberg blocks translatable for further information: Make Custom Gutenberg Blocks Translatable.

Please note that this solution might be irrelevant if it's outdated or not applicable to your case. We highly recommend checking related known issues at WPML Known Issues, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the issue persists, please open a new support ticket: WPML Support Forum.

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

Last updated by Waqas Bin Hasan 1 year, 2 months ago.

Assisted by: Waqas Bin Hasan.

Author Posts
March 6, 2024 at 4:44 pm #15380862

theoH

I contacted you earlier today about this. I was helped bij Noman. I got the advice to follow the instructions on this site 'https://wpml.org/documentation/support/language-configuration-files/make-custom-gutenberg-blocks-translatable/'. I don't think that is the good advice because patterns are no Gutenberg-blocks.
I can understand that the (elements of the) pattern have to be registered in an wpml-config-file. But a need a little more help how to do that. I can't find the right information. Something like Elementor-blocks look a bit similar but I think it's different.
Btw, I'm using WP 6.4.3

March 7, 2024 at 7:51 am #15382503

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

Thank you for contacting the support.

May I ask for the debug information of your website for an overview of your setup? See https://wpml.org/faq/provide-debug-information-faster-support/ for more information.

I've enabled the debug information section for your next reply.

Additionally you can also take a look at https://wpml.org/faq/checklist-before-opening-a-ticket-in-wpml-support/ and cross-check for a few initial fixes.

See https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/ for details on privacy and security.

Regards.

March 7, 2024 at 7:56 am #15382526

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Additionally, please also check https://wpml.org/documentation/getting-started-guide/translating-content-created-using-gutenberg-editor/translating-reusable-blocks/, the process is the same.

March 7, 2024 at 11:07 am #15383846

theoH

Hello Waqas,

Thank you for your respons.

- I followed the checklist and everything is okay. There is only one php-plug-in missing: eval(). Could that be the problem? If so, I'll ask my provider to install it.
- as I mentioned to your collegue Noman yesterday, I followed the instructions for 'reusable blocks. And indeed, I can translate patterns. But the elements that are part of these patterns are missing. I added screenshots.

Screenshot 2024-03-07 at 12.04.38.png
Screenshot 2024-03-07 at 12.03.51.png
March 7, 2024 at 1:11 pm #15384538

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for the updates.

For the eval(), although it shouldn't be a problem, but since it is required by WPML, yes please check with your host and if they can enable it. So we can rule out any possibility due to the lack of this.

Please let me know and we can check further, if issue is still there.

March 8, 2024 at 12:43 pm #15389290

theoH

Hello Waqas,
I unserstood from my hostingprovider that the eval()-function is part of the php-installation on the server.
I hope we can go further now 🙂

March 8, 2024 at 12:58 pm #15389306

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for the updates.

I need to take a closer look at your site. So I request temporary access (WP-Admin and FTP), preferably to a test site where the problem has been replicated.

Your next answer will be private, to share this information safely.

Also provide detailed steps to reproduce the issue and links to pages in admin and on frontend.

IMPORTANT: Please take a complete backup of the site to avoid data loss. I may need to activate/deactivate plugins also.

See https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/ for details on privacy and security.

P.S.: I am just closing my day and 'll be able to get back to you on Monday.

March 11, 2024 at 2:09 pm #15395845

theoH

Do you need anything else?

March 11, 2024 at 5:10 pm #15396786

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for the access, I am working on it and 'll get back to you accordingly.

March 11, 2024 at 5:51 pm #15396885

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for your patience and cooperation.

I tried a pattern from one of your existing ones which has the following footprint:

<!-- wp:block {"ref":218,"content":{"0ueX75":{"values":{"content":"Heading of the pattern testssss"},"blockName":"core/heading"},"0lskp4":{"values":{"content":"Text of the pattern... test....ssssdddd"},"blockName":"core/paragraph"}}} /-->

So I used following XML to register it in WPML -> Settings -> Custom XML Configuration:

<wpml-config>
  <gutenberg-blocks>
    <gutenberg-block type="core/block" translate="1">
        <key name="content">
          <key name="0ueX75">
          	<key name="values">
            	<key name="content" />
            </key>
          </key>
          <key name="0lskp4">
          	<key name="values">
            	<key name="content" />
            </key>
          </key>
      	</key>
    </gutenberg-block>
  </gutenberg-blocks>
</wpml-config>

Then I made some change in the original content, saved and I was able to translate in ATE.

Screenshots are attached for reference, as well as, the test page at hidden link.

Since a pattern is a collection of blocks, which may already been recognized by WPML. But you can consider pattern itself a block, so it needs to be registered/recognized with/by WPML.

You may find this guide https://wpml.org/documentation/support/language-configuration-files/make-custom-gutenberg-blocks-translatable/ handy, as you continue to create and use more patterns.

Screenshot 2024-03-11 224551.jpg
Screenshot 2024-03-11 224508.jpg