Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
The client is having an issue related to ACF where he uses ACF Shortcodes to display ACF Fields in Elementor and the fields were not translated.

As the shortcodes also included raw text this raw text was showing on the translated content.

Solution:
We were not able to identify an issue on this ticket, apart from expected behavior, as the affected ACF Fields and their shortcodes were not yet translated.

If you're experiencing similar issues with Dynamic Visibility and ACF Fields not behaving as expected in translated content, here are the steps you can take:
- Ensure that ACF Fields are filled out, as empty fields can cause visibility issues.
- If changes do not reflect immediately, allow some time as it might take a while for the system to update.
- Check the page URL settings and ensure they are set to 'copy from the primary language' if issues persist.

If this solution doesn't seem relevant to your situation, please open a new support ticket with us, and we'll be happy to assist you further.

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.

This topic contains 18 replies, has 2 voices.

Last updated by Andreas W. 10 months ago.

Assisted by: Andreas W..

Author Posts
January 9, 2024 at 12:10 pm #15164288

eun-kwangH

Needs recreation on sandbox:

- Dynamic Visibility does not seem to work in the second language
- using dynamic visibility to hide certain containers if empty
- display condition is not applied in the second language

January 9, 2024 at 1:39 pm #15164750

Andreas W.
Supporter

Languages: English (English ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

Please try to recreate the issue on the following test site:
hidden link

Elementor PRO, Dynamic Visibility for Elementor, ACF PRO, and WPML incl. add-ons are already installed and activated.

Once you are done with this task, please do not forget to leave me a message on this ticket.

Best regards
Andreas

January 10, 2024 at 5:44 am #15167220

eun-kwangH

Hi Andrew,

I did the following in the website you provided:

1) Changed the default language to Korean.

2) installed CPT UI & Classic Editor.

3) Imported 2 ACF: Insight & Member.

4) Imported 2 Elementor Templates: Insight Post & Team Post.

5) Added 2 posts: one for Insight & the other for Team.
-Insight: hidden link
-Team: hidden link

I believe the issue is duplicated. You will see fields hidden under the primary language show up in the second language without a value.

Also, I would like to let you know that I'm using WP Rocket for caching, and assume the issue is not about cache as it is duplicated without it.

Let me know if there is anything else you need from me in resolving the issue.

Thanks again for your valuable time.

Regards,

EK

January 10, 2024 at 4:33 pm #15170315

Andreas W.
Supporter

Languages: English (English ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

This appears to have nothing to do with Dynamic Visibility for Elementor.

The ACF fields will still show up wrong if I disable the plugin.

When I try to create a new member, I see this:

- Your template uses 5 fields for Education, but your example post only has 2.

- Your template uses 7 fields for Education, but your example post only has 5.

I can not create a new test post without filling out all fields for Education and Experience. This means you did not recreate the issue, you only imported content that was not created on this test site.

This also means, that if the fields are empty on your example post then you are still rendering them on the translated content, as you are calling the fields by shortcode in Elementor and not inside a conditional code block in PHP.

As I said, I see the same issue, even without the addon to make the content dynamic.

It seems that WPML is still translating the signs, that you write between those shortcodes.
Example:

<a href="[acf field=%22team_edu_third_website%22]" target="_blank" rel="noopener">[acf field="team_edu_third_name"] [acf field="team_edu_third_major"]</a> ([acf field="team_edu_third_degree"], [acf field="team_edu_third_starting"]-[acf field="team_edu_third_ending"])

In this example, the ACF field shortcodes can not be rendered on Frontend, as the field are not used on the post, but anyhow all this is copied when translating the post and this is why WPML prints:

(,-)

Those are characters used to wrap the shortcodes like in the output:

(MS, 2000-2002)

Now, as those signs are actually on both templates, this issue is expected. WPML is only trying to render the shortcodes, which have no values on the backend.

January 10, 2024 at 11:22 pm #15171903

eun-kwangH

Hi Andrew,

Thanks for your detailed explanation, but I'm a little lost. It would be appreciated if you can help me to make sure I properly understand it. Here are some questions:

1) If Dynamic Visibility is deactivated, I do not think there is any query to hide certain sections. So, can you please clarify what the expected impact of disabling the plugin?

2) In the Team Post template, there are several containers, each of which is composed of a heading and a HTML widget with ACF shortcode. The intention was to "hide the container" if the ACF field does not have a value. It is fine to leave some ACF fields blank as not all of them are required. (The parenthesis and comma are added in the HTML widget, so I do not think they impact the test for visibility?)

3) What is really confusing to me is why all this works for the primary language and the problem occurs with the translations. If using a shortcode instead of PHP codes is a problem, shoudn't the same problem occur with the primary language as well?

Please bear with me as I'm not a web developer or a programmer. As such, I am getting a lot of help from WordPress with plugins in relation to my main business.

It would be really helpful if you can provide a little more color on my questions above.

Regards,

EK

January 10, 2024 at 11:33 pm #15171908

eun-kwangH

One thing looking a little strange to me is that the Dynamic Visibility does not seem to capture the translation. I'm referring to the the articles below:

https://wpml.org/forums/topic/dynamic-visibility-extension-not-working-on-translated-page/

Basically, I tried to follow the instructions in the article, but couldn't because the article was dealing with "category" while my issue is related to an "ACF field".

hidden link

lobin-dce-english-3.jpg
January 11, 2024 at 12:29 pm #15174409

Andreas W.
Supporter

Languages: English (English ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

About my test:

1) Go to the sandbox:
hidden link

2) Create a new team member

3) You will be forced to enter 5 entries for education and 7 entries for experiences, as you marked those fields as "required". You are not able to publish the posts unless all fields are filled out.

4) Now, translate the post and you should see the same results in both languages.

5) Activate now "Dynamic Visibility for Elementor" and mark the first 5 fields on the template not visible.

6) Translate the template with the WPML Translation Editor.

I can confirm on this sandbox that I see the same results on my created test posts (Original and translation).

According to my test, with a newly created post, it is all working as expected.

Why do you see different results on your imported team member?

- This team member which you imported here, for some reason has fewer fields filled out than those, that are currently set to required in ACF.

- With those settings, it would not be possible to create such a team member, who has not all fields filled out.

January 11, 2024 at 1:18 pm #15174735

eun-kwangH

Hi Andrew,

I see where the misunderstanding started. I did not provide you enough information about Team Post, and it's my bad. Sorry.

1) As you said, all education fields are required. However, You can choose to show which one: you have "show second" field where you can choose "TRUE" or "FALSE". If "False", the second education details will not show up in the editing screen of the post. Same for the other ones.

2) For Team Post, Dynamic Visibility is dependent upon "show" field. If "show second" field is set to "FALSE", the container with second educations details should not be displayed.

3) I just recognized that the value of "show" fields are not translated properly. So, I changed the translation option of them to "copy" instead of "translate", both in the original site and in the sandbox. However, in the post edit screen in English, "show" fields are all "TRUE", even when the value in Korean is "FALSE".

4) I recognized that the default language is set to "English" in "Setting>General" while I changed it to "Korean" in "WPML Site Language" section. Would this have an impact on what you see and what I see?

4) On the other hand, I recognized that Dynamic Visibility for Insight articles are working! I believe you fixed it and thanks a lot.

Regards,

EK

January 11, 2024 at 1:36 pm #15174870

Andreas W.
Supporter

Languages: English (English ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Make sure to:
- set ACF Select Fields to "Copy"
- set ACF Group Fields to "Copy"

More details:
https://wpml.org/documentation/related-projects/translate-sites-built-with-acf/recommended-custom-fields-translation-preferences-for-acf-and-wpml/

Or simply set the whole ACF Field Group to "Same fields across languages", which will make sure that the correct settings are used for each field automatically when translating them with the WPML Translation Editor.

Guide:
https://wpml.org/documentation/related-projects/translate-sites-built-with-acf/#selecting-a-translation-option

January 11, 2024 at 2:09 pm #15175017

eun-kwangH

Hi Andrew,

1) I set the select fields containing "show" in the title to "copy", but it does not copy. I do not have any problem having them "copied" as "TRUE" or "FALSE" values will not be displayed frontend.

2) However, I cannot make all select fields to "copy", as some of them will be displayed frontend and need to be shown in both languages. I've been using WPML for quite a while, but this has never been an issue before. For some reason, select fields do not seem to be translated properly this time.

3) I cannot set the group fields to "copy" either. For example, the group field "second edu" contains all the details of the second education, including school name, major, degree, etc. All of them needs to be in both languages. If I cannot translate them, there is no point for me to use a translation plugin.

Would there be any other way to make this work?

Regards,

EK

January 11, 2024 at 2:35 pm #15175135

Andreas W.
Supporter

Languages: English (English ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

I suggest again setting those fields to "Copy" so that the translated posts use the same setting.

You can make changes or update the translations of field labels, titles, and labels for Choices from WPML → String Translation.

Source:
https://wpml.org/documentation/related-projects/translate-sites-built-with-acf/#translating-labels

January 11, 2024 at 2:47 pm #15175250

eun-kwangH

I just did, but they don't copy.

hidden link

Can you please try at your sandbox and see if it works?

January 11, 2024 at 5:36 pm #15176135

Andreas W.
Supporter

Languages: English (English ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

I would like to invite you to visit the Sandbox and try it for yourself, as I can not confirm any issue here so far, apart from the titles of each section, that are still appearing on the translated content, but this seems to be related to the fact, that they can not be set to "Display" none in your design.

One-Click-Login:
hidden link

Further, I would like to offer to have a closer look at the problem and request temporary access (wp-admin and FTP) to the website to investigate this issue.

You can find the required fields below the comment section when you log in to leave the next reply. The information you provide is private, which means only you and I can see and access it.

IMPORTANT
Please be sure to make a backup copy of the website and database before allowing us access.
If you can't see the wp-admin / FTP fields, your post and website credentials are set as PUBLIC. DO NOT publish the data unless you see the required wp-admin / FTP fields.

I may have to install a plugin called "All In One WP Migration" to make a copy of the website where I can investigate the issue further.

However, I would also be very grateful if you could provide a staging site or copy of the website from your server yourself for this purpose.

If you have any questions about creating such a staging site, you can consult your hosting provider. Just take note that WPML should be registered on this site again.

If you are unable to provide such a copy of the site for testing, please let me know on this ticket.

The private response form looks like this:
hidden link

Next time you reply, click "I still need assistance."

Video:
hidden link

Please note that we are obliged to request this information individually on each ticket. We may not access any access information not specifically submitted on this ticket in the private response form.

January 16, 2024 at 3:33 pm #15190970

Andreas W.
Supporter

Languages: English (English ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

I am sorry to hear that and I hope you are feeling better.

Today I visited your site and I am kind of lost, and I am not sure if I understand the reported issues correctly.

For example, you reported an issue with TRUE/FALSE values not copied to translation, but I can not confirm this issue - the settings are copied on the backend, as long the select fields are set to "copy" and the fields do have a value.

For example:
hidden link

Here you set the original content Education 3 to TRUE but the field has not values and this is why WPML is not copying the settings.

If I set the field on the translation to TRUE you will be forced to enter values for Education 3 and this is not the case, as there is not such field on the original content.

Please take further note, that on this ticket I was unable yet to confirm an issue with the Dynamic Visibility for Elementor plugins.

I saw an issue on my sandbox, that was related to your imported content and I was unable to recreate it when creating brand-new content.

Issues only occur here, if fields do have not any value and are set to true, which is not a correct workflow.

Please read my prior comments regarding this again.

Next, if you still have doubts or further issues on the site, please provide me with very detailed examples of what you are expecting to see on your site and where exactly the issue occurs. Provide me example links to affected contents, and screenshots.

Also, please confirm if you can still recreate the issue when creating brand new content, or if the issue has only affected one or a few contents of your site.

January 17, 2024 at 2:18 am #15192485

eun-kwangH

Hi Andrew,

This ticket started with Dynamic Visibility not working in the second language, and there were 3 troubles: 1) Insight: blank footnote not hidden in the second language, 2) Team: Empty education fields not hidden in the second language, and 3) Team: Empty sections such as Publication, Speech, Selected Works, Accolade not hidden in the second language.

1) Solved. Not sure how though as I have not done anything to the website while you were looking into the sandbox.

2) Solved. I changed the translation option to "copy" as you said. However, it did not reflect this change right away, and took about a day to "copy". "TRUE/FALSE" is not an issue any more.

3) Not solved. The difference of this as compared to 1) is that visibility of a "container" is dependent upon emptiness of an "ACF Field". I still need help to solve this.

Regards,

EK