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.
|July 31, 2019 at 4:31 pm|
(Reposting this here, as my original question was posted to the German support forum, but I typed it in English. OP: https://wpml.org/de/forums/topic/acf-wpml-independent-translation-of-repeater-and-flexible-content-fields/#post-4315201)
I have just taken over development of a web site using WPML in conjunction with a complex ACF setup. The setup includes flexible content layouts, repeaters and clones thereof.
The goal is to make translated pages completely independent from their original language versions: flexible content layout elements should ideally be copied once from the original page when the translated page is created, but after that it should be possible to add, edit and delete layout elements independently for each language version of a page.
I do not intend to translate the backend, so post type 'acf-field-group' is set to 'Not translatable' in WPML settings' 'Post Types Translations'.
The ACF setup looks roughly like this:
Page (field group)
What I have tried:
- Setting all relevant ACF fields to 'Copy once', except tabs, messages, columns* which I i set to 'Don't translate'. (*I'm using the plugin 'ACF Columns')
Result: None of the cloned fields are copied on creating the initial translation. The 'Copy content' button does nothing. On editing and saving the translation (adding and editing new flexible layout fields), the flexible content layout is copied from the original language version (without content if the fields that did not exist in the initial translation). Content in those newly copied fields can be edited and saved, but fields cannot be added or deleted - the layout of the flexible content stays synchronized to the original language version and cannot be changed.
- Setting all relevant ACF fields to 'Translate' (except tabs, messages, columns, see above)
Result: Same faulty behaviour as with 'Copy once'. In addition I get this warning after creating the initial translation: "WPML will copy _wpml_media_duplicate, _wpml_media_featured, sections_0_blocklist, sections_0_side_style, sections_0_side_background from German, when you save this post."
To further inspect this I did the following:
- Install 'WPML Translation Management' plugin to inspect all custom fields in one table (under WPML > Settings > Custom Fields Translation).
Result: I was shocked to discover over 1.700 custom fields in this table (see attached image), all indexed by nested repeater and flexible content fields (e.g 'sections_3_blocklist_2_items_0_content', up to 'sections_5...')! These fields have translation setting values assigned to them that don't reflect the corresponding settings in their field groups, e.g. 'Copy' or 'Don't translate'.
- Why are field entries replicated in this way?
- Next I changed some of the assumingly relevant values here to 'Copy once' (such as the 'sections_0_blocklist' mentioned in the warning)
Result: This seemed to do the trick of making the layouts independent (editing, saving, deleting elements)! However, content and layouts are still not copied over on creation of a translation.
- If this is the solution, how can I 'bulk edit' the field entries in the 'Custom Fields Translations' list - I don't want to edit >1.700 entries manually. Changing the original fields in the field groups doesn't seem to affect the iterations here!
Any assistance in producing the intended behaviour is welcome. Staging site and FTP access can be provided. The backend is unfortunately kept in German, but I can provide assistance via text or voice chat.
|August 1, 2019 at 9:17 am #4320101|
Languages: English (English )
Timezone: Asia/Kolkata (GMT+05:30)
Thank you for contacting WPML Support.
As I can see that you have already reported this issue here: https://wpml.org/de/forums/topic/acf-wpml-independent-translation-of-repeater-and-flexible-content-fields/#post-4315201
Our teammate is handling this ticket in the other thread and he will update you soon.
If you need any help, please let us know.