Code element text is not detected for translations in WPML

Hi,
I need to send everything inside of “Code” element on the page to translations in WPML .
But WPML doesn’t detect anything from Code elements.

I found some tutorials on WPML page to edit the WPML XML configuration , but it doesn’t describe how to detect Code element for Bricks Builder. Found this article, but it’s based on elementor.

Enabling the ‘JSM Show Post Metadata’ plugin I managed to get the following information from

key: "_bricks_page_content_2"
value:
<omitted for brevity>
...
4 =>
array (
'id' => 'pmcvwx',
'name' => 'code',
'parent' => 'qtdefm',
'children' =>
array (
),
'settings' =>
array (
'code' => ' <p>No reliance on past performance:'
...
<omitted for brevity>

There are some examples for wpml-config.xml , but these are for either widgets or shortcodes, is the “Code” element part of any of these?

<wpml-config>
  <shortcodes>
    <shortcode>
        <tag>vc_text_separator</tag>
        <attributes>
            <attribute>title</attribute>
        </attributes>
    </shortcode>
  </shortcodes>
</wpml-config>

Any help is appreciated how to configure WPML xml config to detect “Code” element content for translations.

Hi Ardi,

We’re in touch with WPML’s team regarding this. We can make the code element translatable by default but I’m not sure if that makes sense especially when comparing it to other themes & page builders. However, maybe we can add a filter or setting to make it possible for unique cases like yours. So we’ll see what WPML recommends and see what we can do :slight_smile:

In the meantime, if you’re using the translated code in very few pages or templates, you can edit the translated page with Bricks and add the code. But this is ofc not ideal if you’re constantly re-translating the page using WPML or need this translated code element in multiple pages/templates.

Hi,
I think it would be sense to make it configurable as it’s not always wanted.

Yes, where we had only few pages with translations, we created duplicates for manual editing.
But since we have ~21 languages , we’d still like to be able to have translations option from configuration for Code element since some of the custom stuff we have done (for example a calculator) We’d be able to send to translations in any language then.
I think an awesome solution would be to have some toggle under the “Code” element box, where it could be marked for translations, this way not everything (js, css etc.) would be marked for translations but only specific blocks that are marked.

Question, would widgets translations work for example Title element (custom)?
If we created a custom widget for the calculator for example
Here’s some WPML tutorial I found for elmentor.

Custom Bricks elements should be translatable by default if the control type is one of the following: ‘text’, ‘textarea’, ‘editor’, ‘repeater’, or ‘link’.

Regarding the code element translation, if we add a translation option we would most likely only make it possible to enable or disable it site-wide as implementing an element-specific check would require much more effort.

Alright thanks . Yeah understandable that it would be site wide then.

We’ll be probably testing out the custom element then soon.

Looking forward to updates,
Thanks

1 Like