Sauter la navigation

Ce sujet est résolu. Voici une description du problème et de la solution.

Problem:
The client is trying to translate FluentForm IDs using WPML with different IDs for French and English versions, managed through Divi builder. The client faced issues where the FluentForm ID was not appearing in the 'Edit translation' section and was incorrectly modified in the source language upon updates.
Solution:
1. Add the following XML configuration to WPML > Settings > Custom XML Configuration:

<wpml-config>
  <shortcodes>
    <shortcode>
      <tag>fluentform</tag>
      <attributes>
        <attribute>id</attribute>
      </attributes>
    </shortcode>
  </shortcodes>
</wpml-config>

2. Insert this code at the top of your theme's functions.php file to make the form ID translatable:

add_filter('wpml_tm_job_field_is_translatable', '__return_true');

3. Make a minor edit to the page where the shortcode is used to refresh WPML elements.
4. Search for the form ID using the search bar in the translation editor.

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 the problem persists, please open a new support ticket at WPML support forum.

Il s'agit du forum d'assistance technique de WPML, le plug-in multilingue pour WordPress.

Il est accessible à tous, toutefois seuls les clients de WPML peuvent y publier leurs messages. L'équipe du WPML répond sur le forum 6 jours par semaine, 22 heures par jour.

Marqué : 

Ce sujet contient 0 réponse, a 0 voix.

Dernière mise à jour par victorM-56 Il y a 2 jours et 7 heures.

Assisté par: Ilyes.

Auteur Articles
mars 14, 2025 à 4:49 pm #16818033

victorM-56

Background of the issue:
I am trying to translate fluentform ID using WPML. For each fluentform, I created two forms: French and English, each with different IDs. I have to manually modify the translated page with the new fluentform ID using Divi builder. I already tried using the following shortcode but it is not working: <shortcode> <tag>fluentform</tag> <attributes> <attribute>ID</attribute> </attributes> </shortcode>. Link to a page where the issue can be seen: lien caché

Symptoms:
When I modify the source page, the fluentform ID is modified in the source language. I expected to see fluentform_ID in 'Edit translation' so I can translate it, but instead, I got nothing in 'Edit translation'.

Questions:
How can I ensure the fluentform ID is available for translation in 'Edit translation'?
Why is the fluentform ID being modified in the source language when I update the source page?

mars 15, 2025 à 10:41 am #16819657

victorM-56

EDIT : I temporary modify french page and put english form (instead of french) to have english form on english and german pages too. Because this porblem has a big impact (to have french form on english and german page).

Thanks for your help,

mars 17, 2025 à 3:05 pm #16825965

Ilyes
Supporter

Les langues: Français (Français )

Fuseau horaire: Pacific/Easter (GMT-05:00)

Hello,

Thank you for contacting WPML support team,

We actually had this issue reported before here : https://wpml.org/forums/topic/fluentform/

You can try the solution suggested by my colleague :

Add this to WPML > Settings > Custom XML Configuration

<wpml-config>
  <shortcodes>
    <shortcode>
      <tag>fluentform</tag>
      <attributes>
        <attribute>ID</attribute>
      </attributes>
    </shortcode>
  </shortcodes>
</wpml-config>

Then edit the page with Divi slightly where the shortcode is called (add a character or space) to refresh WPML elements, this will add the form ID to be translated to the translation editor,

Best,

mars 17, 2025 à 4:50 pm #16826584

victorM-56

Hi,

Thanks for your answer.

As explained, I already put this XML but impossible to see form ID in the translation editor.

I tried again today (with a small modification on source page), no ID.

Thanks for your help,

Victor

mars 18, 2025 à 12:53 am #16827450

Ilyes
Supporter

Les langues: Français (Français )

Fuseau horaire: Pacific/Easter (GMT-05:00)

Hello,

I would like to ask for temporary access to your test site’s wp-admin and FTP to investigate the issue further.

It is important to note that you should back up your site and database before proceeding, and you can use a plugin like Duplicator for this purpose. Here’s a link to the plugin: http://wordpress.org/plugins/duplicator/

If you do not see the form below, please do not enter your credentials as they will be publicly exposed:

lien caché

For your privacy and security, please ensure that you make your reply a private one.

Best regards,

mars 18, 2025 à 10:38 pm #16832799

Ilyes
Supporter

Les langues: Français (Français )

Fuseau horaire: Pacific/Easter (GMT-05:00)

Hello,

What is interesting about this, is that the XML solution suggested before used to work and now it is not,

I kept debugging to understand the issue, but it seems translating shortcodes in general is not possible when they are called like that, at least for the time being,

I have sent your site to our developers to get a second opinion,

In the meantime, you can simply change the ID manually by editing the translation directly using Divi,

I will get back to you with more details,

mars 19, 2025 à 10:09 am #16834347

victorM-56

Hello,
Unfortunately, when I edit manualy using DIVI, it works until there is a new change on the source page.
If I modify something in the french page, ID will again change on the english page to the french ID form.

mars 20, 2025 à 7:06 pm #16841719

Ilyes
Supporter

Les langues: Français (Français )

Fuseau horaire: Pacific/Easter (GMT-05:00)

Hello,

You are right, this is just a temporary solution until I get a response from our team,

So the thing is that FluentForm is not compatible with WPML, hence this shortcode is not coded to be translated,

You could actually debug the shortcode and modify it like suggested here : https://wpml.org/documentation/support/language-configuration-files/translate-custom-shortcodes-with-wpml/#translate-id-based-shortcodes

Also, adding this code to your theme's functions.php should enable WPML to translate numbers :

add_filter( 'wpml_tm_job_field_is_translatable', '__return_true' );

Could you please save a backup of you site and test it again?

Best,

mars 22, 2025 à 6:10 pm #16847891

victorM-56

Hello,

I added with code snippet : add_filter( 'wpml_tm_job_field_is_translatable', '__return_true' );

Unfortunately, I can't find any ID to translate.

Thanks for your help

mars 25, 2025 à 2:58 pm #16858623

Ilyes
Supporter

Les langues: Français (Français )

Fuseau horaire: Pacific/Easter (GMT-05:00)

Hello,

One last step is missing, and it is to simply search for the ID using the search bar on the top : lien caché

So to conclude, here are all the things to do in otder to translate this shortcode ID :

1- Add this XML to the configuration file :

<wpml-config>
  <shortcodes>
    <shortcode>
      <tag>fluentform</tag>
      <attributes>
        <attribute>ID</attribute>
      </attributes>
    </shortcode>
  </shortcodes>
</wpml-config>

2- Add this code at the top of your theme's functions.php:

add_filter( 'wpml_tm_job_field_is_translatable', '__return_true' );

3- Apply a small edit to the original page where the shortcode is called.
4- This will change the translation status and refresh the elements
5- Open the translation editor and search for the number at the top search bar

I couldn't apply it for you on your site as the access seems to be expired, could you share another access as I would need it for your rank math ticket,

Best,

mars 25, 2025 à 3:57 pm #16858882

Ilyes
Supporter

Les langues: Français (Français )

Fuseau horaire: Pacific/Easter (GMT-05:00)

Okay, this happens specifically if the ID is part of a Toggle in DIVI, this is a compatibility issue,
Locally, I tested on a normal text block and it worked, so either switch to a different block or wait a little bit longer as I send this to our compatibility team again,

I will recreate the issue on a new wordpress installation, and get back to you asap,

Best,

mars 25, 2025 à 4:34 pm #16859088

Ilyes
Supporter

Les langues: Français (Français )

Fuseau horaire: Pacific/Easter (GMT-05:00)

Hello again,

I would need your help as the issue is not replicating on a new installation,

Please access this sandbox : lien caché

I have made the same changes I suggested before with the XML and php code, and the ID is translated correctly using text and toggle divi block,

Am I missing something? could you please check if I made a similar block?

PS: English form is ID=3 and French is ID=4.

Best,

mars 25, 2025 à 4:57 pm #16859149

victorM-56

I tried your sandbox.
It works there.

Maybe something is not good instaled on my WPML.
For example I see API REST is not activated (but from my hosting, it's activated).

mars 25, 2025 à 5:10 pm #16859209

Ilyes
Supporter

Les langues: Français (Français )

Fuseau horaire: Pacific/Easter (GMT-05:00)

Since the issue only happens specifically on the live site, so you have a staging/testing version where you could disable plugins?

Please check if the issue persists in a minimal environment by following these steps.
1- Deactivate all the plugins except WPML CMS, DIVI and Fluentform.
2- Create a new page with a fluentform shortcode and translate it

If the issue is gone, activate them one by one to see which one there is causing an interaction issue.

Best regards,

mars 25, 2025 à 6:55 pm #16859613

Ilyes
Supporter

Les langues: Français (Français )

Fuseau horaire: Pacific/Easter (GMT-05:00)

Hello,

While checking the rank math media issue, I noticed that the forms IDs are now loading : lien caché

Could you check again ?