Home›Support›English Support›[Resolved] Prevent WPML from translating ACF Pro variables inside Bricks Builder
[Resolved] Prevent WPML from translating ACF Pro variables inside Bricks Builder
This thread is resolved. Here is a description of the problem and solution.
Problem: You are experiencing issues with WPML translating ACF Pro variables within Bricks Builder, causing layout disruptions upon updating translations. Solution: Note that this issue was already resolved in one of the latest updates for the Advanced Translation Editor. The tags might still show up inside the translation editor, but automatic translation should not affect them.
Alternative workarounds:
1. Use the Glossary Feature in the Advanced Translation Editor to declare dynamic tags as general terms to prevent them from being translated. For guidance, visit How to get better translations using WPML Glossary. 2. Alternatively, consider using a different theme and displaying fields with PHP. For more information, check Displaying custom field values in your theme. 3. To exclude ACF Pro variables from being translated in Bricks Builder, add the following code to the end of the functions.php file of your Bricks Theme:
If this solution does not resolve your issue or seems outdated, we recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If further assistance is needed, please open a new support ticket at 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.
Background of the issue:
I'm trying to prevent WPML from translating ACF Pro variables inside Bricks Builder on my site hidden link. I am following the documentation at hidden link.
Symptoms:
Every time I update a translation, my layout breaks. hidden link
Questions:
How can I stop WPML from translating ACF Pro variables within Bricks Builder?
Languages: English (English )Spanish (Español )German (Deutsch )
Timezone: America/Lima (GMT-05:00)
Hello,
This problem seems to be currently expected, as the automatic translation engine will not know how to handle strings like "{acf_carreira_1_botao}".
WPML would need to check the Bricks content for dynamic tags first and make sure that those are not send to the translation editor interface.
For now, you could try to use the Glossary Feature of the Advanced Translation Editor to avoid such unexpected translations. You can declare the dynmaic tags as general terms (names), which will make sure that they are not longer getting translated.
I hope this might be a workaround for this particular case.
I will now try to recreate this issue on a new test site and then escalate this problem internally, so that our compatibility team can work on a solution for this problem.
You need to add a Bricks license so I can reproduce the problem.
Another thing, I added 3 options with OTGS Installer:
- WPML Multilingual CMS
- String Translator
- An ACF Pro option that I don't remember the name of
Languages: English (English )Spanish (Español )German (Deutsch )
Timezone: America/Lima (GMT-05:00)
My apologies, I have registered Bricks now on the sandbox.
The translation works as expected, as you can see here: hidden link
For the translation to work, the placeholders need to be identical in both languages.
At automatic translation engine will not know how to handle such placeholders and translate them.
The possible workaround using the glossary seems not to solve the issue on my test.
This means, that this is a typical case where a review needs to be done for the translation and anything that is not expected automatically as expected needs to be adjusted manually.
Furthermore, if our ATE might be able to consider adding specific flags to exclude such placeholders from translation, would need to be discussed internally and I need to confirm this with the team first.
Once I have feedback on this matter I will contact you again.
Languages: English (English )Spanish (Español )German (Deutsch )
Timezone: America/Lima (GMT-05:00)
What you are actually translating are the following Bricks Widgets:
- Title
- Basic Text
- Button
Any text inside those widgets would be expected to appear on the WPML Translation Editor.
As you are using automatic translation, the translation engine (DeepL, Microsoft, Google, etc.) will expect those strings to be translated and this is how the issue occurs.
For now, I would like to wait until our second tier support will provide more feedback. There is sadly not anything further I can offer to avoid this issue.
How to solve the issue?
- set WPML > Settings > Translation mode to review automatic translation before publishing
- correct the automatic translation while making your review
Languages: English (English )Spanish (Español )German (Deutsch )
Timezone: America/Lima (GMT-05:00)
You are using Bricks Builder to display the fields and what you are translating on the WPML Translation Editor are Bricks widgets that contain placeholders to display ACF fields.
You could use another theme and display the fields with PHP, which would solve the issue.