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 2 replies, has 2 voices.

Last updated by kevinB-5 1 year, 5 months ago.

Assisted by: Long Nguyen.

Author Posts
June 2, 2023 at 10:36 am #13760705

kevinB-5

When using Advanced Custom Fields Pro, I am used to distributing the custom fields using the acf-json files that it generates. But when using WPML and ACFML, I notice that the acf-json files are not generated per language.

In my local (development environment) I configured the fields for the main language and then used the "Language" box on the top of the page to create the options for the secondary language as well. All seems fine, I see options in the primary and secondary language.

So I committed my changes and expected to see the fields in the secondary language on the live environment as well. But it does not work. No acf-json files are being generated for the secondary language in this procedure.

If I open the field settings (in the local environment) for the secondary language and save those, I do get an acf-json file. But now WPML will no longer synchronise the settings of the fields between the primary and secondary language.

I sincerely hope that I don't have to create all field groups manually. Over time and with multiple environments, this would be a lot of labor over time if changes need to be made to the fields.

What's the correct procedure to distribute fields across multiple environments?

Scherm­afbeelding 2023-06-02 om 12.30.35.png
June 6, 2023 at 2:13 am #13774883

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi Kevin,

Thank you for contacting WPML support, I'd be happy to help you with this issue.

The field group should not be translated, please go to WPML > Settings > Post Types Translation > Set the post type "acf-field-group" to Not Translatable.

When using ACF Multilingual, you only need to create the field group in the default language, the field value will be translated along with the post content.
So in your case, you only need to export the field group to the json file and import it to the second site in the default language.

Please read more in the documentation https://wpml.org/documentation/related-projects/translate-sites-built-with-acf/

Look forward to your reply.
Thanks

June 6, 2023 at 9:40 am #13777123

kevinB-5

Hi Nguyen,

Thanks for your response. I found out about this setting as well when I was comparing two environments.

Maybe it's a good idea to let ACFML change this setting automatically? Or notify the user about it needing to be changed? Or is there a use case in which the setting should be "translatable"?