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.

This topic contains 5 replies, has 3 voices.

Last updated by Andreas W. 1 year, 9 months ago.

Assisted by: Andreas W..

Author Posts
September 7, 2023 at 10:09 am #14358303

andreasY-2

Hello there,

I am trying to: Translate the custom post types (Programs) and their fields.
We can see the fields on the Advanced translation page, but we can not print them on the front end.
if( have_rows('courses') ):
while( have_rows('courses') ) : the_row();

Following the documentation here:
https://wpml.org/documentation/related-projects/translate-sites-built-with-acf/#setting-repeater-and-flexible-fields-translation-preferences
and the ticket provided solution here:
https://wpml.org/forums/topic/advanced-custom-fields-repeater-not-showing-on-translated-page/#:~:text=Solution%3A,be%20set%20as%20"Translate".&text=This%20is%20the%20technical%20support,WPML%20-%20the%20multilingual%20WordPress%20plugin.

- We have set the repeater fields as Translated once and the subfields as Translate,
- We have cleared the server cache.
- We have cleared the WPML cache
- We have saved the original posts
- We have re-save the translated post

hidden link

Do we have to delete the translated post and translate it again to solve the issue?

I really appreciate any help you can provide.

Kind regards

September 8, 2023 at 12:22 pm #14366497

Alejandro
WPML Supporter since 02/2018

Languages: English (English ) Spanish (Español ) Italian (Italiano )

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

Hello!

I'd like to ask something just to get a better understanding of your situation: in the current Advanced Custom Fields Multilingual plugin you have an option that will set the fields for you automatically and it's recommended when you're going to use the advanced or classic translation editor that WPML provides.

The option i'm talking about is the one is "Same fields across all languages" mentioned here: https://wpml.org/documentation/related-projects/translate-sites-built-with-acf/#selecting-a-translation-option

Have you given that option a try?

once that option has been set, you'd have to go to WPML > Translation management and translate those page, so the ACF configuration passes to the translations and that should help you out.

----------------------

However, if this still doesn't work, the next step would be to do a var_dump on the fields that are not working, and check if you have nested repeaters, repeaters inside flexible fields or if you have fields with the same name in other custom fields (like a text field called "text1" both inside a repeater and outside it, for example), just to see if there are differences.

if that still doesn't work, then please allow us access to the site and let us know the name of the field group and the page where we can test it. if possible allow us FTP and the path to the template that contains the code for the repeater so we can run some tests there as well.

Regards.

September 8, 2023 at 12:39 pm #14366669

andreasY-2

Hello Alejandro,

This was really helpful. We were missing the setting of keeping the same field across the languages.

Although the repeaters were fixed, now we are missing the last text field, which is displayed on the Advanced editor we have translated it but this is not visible on the front end.

I have detected that the field name is the following: program_learning_outcomes list
and there is a break in the name. Can this cause the issue?

Thank you for your help

Kind regards

September 10, 2023 at 12:35 am #14370375

Andreas W.
WPML Supporter since 12/2018

Languages: English (English ) Spanish (Español ) German (Deutsch )

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

Hello,

I am glad to hear that the main issue was already solved.

Indeed, ACF field names should not have any blank spaces.

Could you please try to adapt:

program_learning_outcomes list

to

program_learning_outcomes_list

Now, edit the text field in any original content of your choice and apply the translation again.

If this will not solve the issue, please let me know.

Best regards
Andreas

September 11, 2023 at 9:26 am #14374215

andreasY-2

Hello Andreas,

Is there any other way to avoid the change? We have already added a lot of content on those fields in the original language

Kind regards

September 12, 2023 at 1:16 pm #14384131

Andreas W.
WPML Supporter since 12/2018

Languages: English (English ) Spanish (Español ) German (Deutsch )

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

Hello,

I am sorry, but it is very likely that this is the cause of the issue and ACF ever uses underscores for field names.

Could you please confirm if changing the field name, editing the field on the original content, and translating this content again solve the issue?

Best regards
Andreas

September 21, 2023 at 12:07 pm #14438525

andreasY-2

We have made the changes along with the data transfer on the new custom fields and the translations worked as expected.

Thank you very much for your support, Andreas.