[Resolved] Translating or registering pattern-contents
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:
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.
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.
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
- 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.
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.
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 🙂
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.
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:
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.
We use cookies to optimize our website and services. Your consent allows us to process data such as browsing behavior. Not consenting may affect some features.
Functional
Always active
Required for our website to operate and communicate correctly.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
We use these to analyze the statistics of our site. Collected information is completely anonymous.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
These cookies track your browsing to provide ads relevant to you.