Skip Navigation

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.

Sun Mon Tue Wed Thu Fri Sat
- 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 -
- 12:00 – 16:00 12:00 – 16:00 12:00 – 16:00 12:00 – 16:00 12:00 – 16:00 -

Supporter timezone: Europe/Zagreb (GMT+01:00)

Tagged: 

This topic contains 0 replies, has 0 voices.

Last updated by Dražen 5 days, 23 hours ago.

Assisted by: Dražen.

Author Posts
January 8, 2025 at 11:35 am #16573037

pascalS-9

Background of the issue:
I am using the WPForms and WPML integration, and it is translating all the Smart Tags, which stops them from working. I am trying to prevent them from being translated. There are strings like {all_fields} and all hidden values. Link to a page where the issue can be seen: hidden link

Symptoms:
The Smart Tags are being translated, resulting in {all_fields} being shown as {alle_Felder}.

Questions:
How can we stop Smart Tags from being translated?

January 8, 2025 at 12:06 pm #16573138

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+01:00)

Hello,

I have added the Pro version of the plugin:

- hidden link

Please try to reproduce it and share a step-by-step guide so I can try it also.

Regards,
Drazen

January 8, 2025 at 12:44 pm #16573367

pascalS-9

Done, I have added 3 of them and translated the form and, they are being translated but in this case, there is an "es" added to the beginning which might be related to the translating engine.
You can check the site or screenshots below

Screenshot 2025-01-08 134324.png
Screenshot 2025-01-08 134206.png
January 8, 2025 at 1:16 pm #16573575

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+01:00)

Hello,

thanks, I have escalated this issue to our compatibility team for a permanent fix, in the meantime as a workaround you manually edit and adjust the translation for these tags, and make them correct.

Regards,
Drazen

January 14, 2025 at 7:43 am #16591433

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+01:00)

Hello,

can you please try next workaround and re-translate the form:

Workaround
Add the following code in your functions.php file

// WPML Workaround for compsupp-7788
add_filter( 'wpml_tm_job_field_is_translatable', 'compsupp_skip_wpforms_smart_tags', 10, 2 );

function compsupp_skip_wpforms_smart_tags( $is_translatable, $job_translate ) {
    $data = $job_translate['field_data'];
    if ( 'base64' === $job_translate['field_format'] ) {
        $data = base64_decode( $data );
    }
    // Check if data exists and starts with '{' 
    if (isset($data) && strpos($data, '{') === 0) {
      return false;
  }

  return true;
}

Regards,
Drazen