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
9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 - -
- - - - - - -

Supporter timezone: Africa/Cairo (GMT+02:00)

Tagged: 

This topic contains 8 replies, has 0 voices.

Last updated by marvinH-9 10 hours, 53 minutes ago.

Assisted by: Osama Mersal.

Author Posts
January 23, 2025 at 8:04 pm #16629730

marvinH-9

Background of the issue:
I have an existing WooCommerce webshop with the following plugins installed: Advanced Custom Fields PRO, Advanced Custom Fields Multilingual, WPML Multilingual CMS, and WPML String Translation. Some of the ACF fields are programmed via PHP as per the reference: hidden link. I am trying to translate my WooCommerce ACF (PHP registered) webshop with WPML auto translations. The site is currently under development.

Symptoms:
My flexible fields are not being recognized by WPML. I followed the documentation at https://wpml.org/documentation/related-projects/translate-sites-built-with-acf/setting-the-translation-preferences-for-acf-fields-created-using-php-code/, and tried steps like changing the PHP code, saving an existing page with flexible fields, and attempting to auto-translate in WPML. However, it only recognizes the title.

Questions:
How can I get WPML to recognize and translate my flexible fields?
What steps should I follow to ensure all ACF fields are translated correctly?

January 26, 2025 at 10:21 am #16634663

Osama Mersal
Supporter

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+02:00)

Hi,

Thanks for contacting WPML forums support. I'll be glad to help you today.

First of all, sorry for the late reply; it was due to a higher workload.

Please check this page and try the workaround mentioned there.

Kindly let me know if the mentioned workaround fixes the issue.

Best regards,
Osama

February 4, 2025 at 1:26 pm #16666883

marvinH-9

Hi Osama,

Thanks for your answer. I only don't really understand how this workaround would help me in this situation.

Currently my ACF fields are not displaying in the custom fields section in my WordPress account because they're built with PHP.

How could I make the transition to using this the fastest? Which steps do I have to take from my current situation? It sounds like a lot of work to get this working on a short notice.

Best regards,

Marvin

February 4, 2025 at 2:11 pm #16667233

Osama Mersal
Supporter

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+02:00)

Hi Marvin,

Please log in to this hidden link">sandbox site and add your fields code. After that, please let me know how to reproduce the issue so I can consult our compatibility team if we have another workaround.

Best regards,
Osama

February 4, 2025 at 6:10 pm #16668180

marvinH-9

Hi Osama,

Thanks for your fast response!

I can log in to the sandbox site, that works good. Only thing is, I don't really see where I have to add the fields code.

I registered it via: acf_add_local_field_group(). So the fields code is living in my theme and registered via functions.php.

Do you want me to share that php file with you? So that your team can find a workaround maybe?

Cheers,

Marvin

February 5, 2025 at 9:28 am #16669647

Osama Mersal
Supporter

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+02:00)

Hi Marvin,

Thanks for your reply. Please add the code to the hidden link">functions.php file on the sandbox site.

You can add it using the file manager plugin or Appearance-> Edit theme files.

Thanks,
Osama

February 11, 2025 at 12:26 pm #16691527

marvinH-9

Hi Osama,

Thank you.

I just added my function to register the fields to the functions.php.

Thanks,
Marvin

February 11, 2025 at 2:03 pm #16692037

Osama Mersal
Supporter

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+02:00)

Hi Marvin,

Thanks for importing the code to the sandbox site. Please check the following steps:

1- Install this hidden link">plugin
2- Follow its Usage doc to convert the field groups
3- Go hidden link">here and check if all groups are imported correctly
4- Edit each group to see if the translation preferences are correct
5- Go hidden link">here, toggle all group,s and export as JSON

If everything works correctly, you would need to delete the PHP code for the field groups.

Kindly check the result on the sandbox site and let me know if it works as expected.

Best regards,
Osama

February 11, 2025 at 4:35 pm #16692934

marvinH-9

Hi Osama,

Great thanks this works! It looks like WPML is recognising my fields and counts the words right now.

Only problem I get now, if I want to start translating using the WPML translation editor it gives me an error with 'File size limit exceeded', 'unable to retrieve job content'.

I hope you can help me further. I already tried this: https://wpml.org/forums/topic/file-size-limit-exceeded-notification/

Thanks,

Marvin

February 11, 2025 at 4:43 pm #16692970

Osama Mersal
Supporter

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+02:00)

Hi Marvin,

I would need to look closely at your site, so I would need to request temporary access (WP-Admin and FTP)
Preferably to a test site where the problem has been replicated.

Your answer will be private, meaning only you and I can access it.

❌ Please backup your database and website ❌

✙ I need your permission to deactivate and reactivate the plugins and themes and change site configurations. This is also why the backup is critical.

✙ I also need your permission to take a local copy of your site to debug the issue without affecting your live site.

Best regards,
Osama

February 12, 2025 at 9:58 am #16695315

Osama Mersal
Supporter

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+02:00)

Hi Marvin,

Thanks for the access details. I installed a local copy of your site and the translation editor opens correctly when I change the theme.

Please change your site's theme to the Twenty-One theme and check if the translation editor will open correctly.

Before translating it, kindly make a minor edit to the page in the default language.

Best regards,
Osama

February 12, 2025 at 8:48 pm #16699096

marvinH-9

Hi Osama,

Thank you checking it out!

So far I cannot get it to work yet..

When I make a minor change (nonetheless if it is on the Recnition theme or Twenty-one theme) and try to translate, I don't get to the translation screenl.

Also if I'm in my translation management and try to cancel any Jobs or remove translations nothing is happening but it is only showing errors. Or it says 'The job has been cancelled' while its not being removed.

I have the feeling it is still quite buggy and I'm not getting to the point where I can start auto translating certain pages (thats the reason I purchased the plugin).

I hope you can get me further!

February 13, 2025 at 11:00 am #16701279

Osama Mersal
Supporter

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+02:00)

Hi,

Thanks for your update. I created a test site on our testing server to debug the issue further. (hidden link)

On this test site, I updated all the plugins and WordPress core. After that, I changed the translation preferences for the group fields to Same Fields Across Languages to avoid any unwanted content in the translation editor.

However, none of the above didn't fix the issue, so I'll consult our 2nd tier support team and update you as soon as I get their reply.

Best regards,
Osama

February 14, 2025 at 12:12 pm #16706203

Osama Mersal
Supporter

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+02:00)

Hi,

Thanks for your patience. Our ATE team has found that most of the problematic segments are field labels and choice fields. For example:

trans-unit extradata="Field choices"
				resname="acfml-group-7237-field-7244-choices-80ea0b719c7684b31a4c3c34d0c71234"
				restype="string" datatype="html"
				id="acfml-group-7237-field-7244-choices-80ea0b719c7684b31a4c3c34d0c71234">
				<source><![CDATA[&#xf20a; fa-cc]]></source>
				<target><![CDATA[&#xf20a; fa-cc]]></target>
			</trans-unit>

In order to fix this issue, you need to exclude the field choices and labels from a post-job. (https://wpml.org/documentation/related-projects/translate-sites-built-with-acf/acf-multilingual-acfml-constants-and-hooks-reference/#acfml_exclude_field_group_strings_in_post_jobs)

After adding this line to the wp-config.php:

define( 'ACFML_EXCLUDE_FIELD_GROUP_STRINGS_IN_POST_JOBS', false );

Please update the page in the default language and translate it.

Best regards,
Osama

February 17, 2025 at 9:04 pm #16716366

marvinH-9

Hi Osama,

Thanks for your response!

We're coming a bit close I have the feeling, but it is still not working as expected..

Currently there are still some 'jobs' in my translation management. I have the feeling one or a few of those are crooked.

Also the automatic translations queue is stuck, so the translations are not being done atm...

In some cases when I get to the WPML translation page I get error messages.

I've added some screenshots.

I hope we can get started using the translation soon!

Cheers!

Schermafbeelding 2025-02-17 om 22.00.25.png
Schermafbeelding 2025-02-17 om 21.57.01.png