Skip Navigation

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

Problem:
The client is using Advanced Custom Fields (ACF) and has issues with batch-selecting fields for translation using the

acf_add_local_field_group

function. They have successfully implemented the

wpml_cf_preferences

attribute in their local environment as per our documentation, but are facing problems in the development environment where fields are not consistently available for translation, especially with multi-level arrays. They also inquired about reindexing fields to include new fields and troubleshooting the scanning of fields created with PHP.

Solution:
1. We asked the client to check if the fields are now appearing correctly in the Advanced Translation Editor (ATE) by providing a link to a specific post in their development environment.
2. We advised the client to:
- Open ATE and complete the translation for fields that were present.
- Make a slight change to the original content (e.g., changing the Logo size value).
- Resave the original content.
This process should make the fields appear if they were added after some translations had already started, as the ACF configuration files would not take effect until the original content is resaved.

If this solution does not seem relevant or if the problem persists, we recommend opening a new support ticket with us for further assistance. You can do so by visiting the 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.

Tagged: 

This topic contains 9 replies, has 2 voices.

Last updated by Bruno Kos 1 year, 6 months ago.

Assisted by: Bruno Kos.

Author Posts
November 20, 2023 at 1:27 pm #14877421

Nazar Kurnyk

Our website is based on ACF, we use the `acf_add_local_field_group` function to manage fields, and I'm looking for a way to batch-select all fields for translation.

I previously discussed with your support team the possibility of using the wpml_cf_preferences attribute as recommended in your documentation: [WPML Documentation Link] - https://wpml.org/documentation/related-projects/translate-sites-built-with-acf/translating-acf-blocks-with-wpml/#preparing-programatically-registered-fields-for-translation.

Indeed, this approach worked in my local environment. However, I'm encountering issues in the development environment where it doesn't seem to function as expected, and I'm unclear about the cause of this problem.

Additionally, looking at the local environment, I noticed that not all fields are being translated, even though I've double-checked their attributes and everything appears correct. Most issues arise with multi-level arrays. For instance:

field-modules_0_module_general_0_columns_0_description is available for translation.
field-modules_1_module_general_0_columns_0_description is omitted.
field-modules_2_module_general_0_columns_0_description is again available for translation.

I've conducted numerous tests but can't pinpoint why this inconsistency occurs. Also, I'm curious about how to initiate a reindexing of fields to include new fields and generally how this reindexing process works.

Additionally, I discovered a setting that allows for scanning fields created with PHP, but unfortunately, this function isn't working for me. Is there a way to troubleshoot or fix this issue?

Any insights or guidance you can provide would be greatly appreciated.

Знімок екрана 2023-11-20 о 15.23.01.png
November 22, 2023 at 6:59 am #14892977

Bruno Kos
WPML Supporter since 12/2018

Languages: English (English ) German (Deutsch ) French (Français )

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

Hi,

Thank you for contacting WPML support!

Let's focus on one issue at a time (for our support rules) and we can split the ticket later. When you say:

"However, I'm encountering issues in the development environment where it doesn't seem to function as expected, and I'm unclear about the cause of this problem."

Can you clarify this a bit more, what doesn't work? Is that an issue with multi-level arrays or is this another issue?

Regards,
Bruno Kos

November 22, 2023 at 11:47 am #14897261

Nazar Kurnyk

Hi,

Let's start with the local environment, this is my computer where I work with the code. The dev environment is one of the sites we use for testing before uploading to production.

I added wpml_cf_preferences to my ACF file, and it's working on my local env but for some reason doesn’t work on dev env.

November 22, 2023 at 12:38 pm #14897517

Bruno Kos
WPML Supporter since 12/2018

Languages: English (English ) German (Deutsch ) French (Français )

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

What doesn't work in dev env, can you send a screenshot or perhaps record a video using tool such as hidden link?

November 23, 2023 at 1:51 pm #14908777

Nazar Kurnyk

Hi,

Here is a short video, I hope you understand what I meant

hidden link

November 23, 2023 at 3:43 pm #14910097

Bruno Kos
WPML Supporter since 12/2018

Languages: English (English ) German (Deutsch ) French (Français )

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

Would you be willing to provide me with WordPress credentials so I could investigate the issue directly?

And send me the URL of the page from the video, where only few segments show up.

https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/

I marked your next reply as private so that you can safely add credentials.

November 24, 2023 at 11:31 am #14916327

Nazar Kurnyk

Hi, yes for sure, but could give me your email to register access for you?

Or you can use this link
hidden link

Here is a page that needs to be translated.
hidden link

Btw I added a translate parameter only for Flexible Visual Template by pages. So if you want to check other pages check this template.

Thanks!

November 24, 2023 at 12:34 pm #14917243

Bruno Kos
WPML Supporter since 12/2018

Languages: English (English ) German (Deutsch ) French (Français )

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

Can you check now?

hidden link

Open in ATE and check the fields there. Are they appearing now correctly? Can you check for any other page with the same issue?

If so, this is what I have done:
- Opened ATE and completed the translation for 3 fields that were there
- made a slight change the original ( only changing the Logo size value)
- resaved

And now they appear - if this is working in other instances also, the reason is that most likely you added your ACF configuration files after you started some of the translations on this site, so these have not taken effect yet until the original is resaved.

November 27, 2023 at 2:55 pm #14931659

Nazar Kurnyk

Yeah seems it's working. So I need just resave the original, thanks!

Another question, how can I merge the lines that were separated, because the translators will not understand the common content.

Here is example
hidden link

The same things are happening with all HTML content. Is there any way to merge to use lines in one?

Знімок екрана 2023-11-27 о 16.52.23.png
Знімок екрана 2023-11-27 о 16.51.55.png
November 28, 2023 at 6:55 am #14935971

Bruno Kos
WPML Supporter since 12/2018

Languages: English (English ) German (Deutsch ) French (Français )

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

It is only possible like this:
https://wpml.org/documentation/translating-your-contents/advanced-translation-editor/#joining-sentences

But it is not possible to change how it works as there are algorithms that decide which sentences may be joined based on how they are created, etc.

November 29, 2023 at 9:34 am #14948095

Nazar Kurnyk

That seems to be it, thanks for the help, I'll get back to you if I have any questions