since I just ran into the same problem I am posting what I found out to make it work in my environment. Maybe it’ll help you and others (possible duplicate: http://support.advancedcustomfields.com/forums/topic/wpml-and-gallery-field/) to get this to work.
I have a WPML setup with 3 languages and needed title, caption und alt translations.
A. First you have to install the “WPML Media-plugin” from the WPML toolkit, and run through it’s setup. It creates database-duplicates of all your media giving you the possibility to translate the meta information.
B. Once done, go to WP-Media and click “edit” on the attachment you want to translate.
C. If you now change your selected language via the WPML adminbar switch you are able to put in translations for captions and such. You can confirm your success when hitting the save button and watching the permalink of the attachment being appended by a number like slug-2.jpg (if you don’t change the title).
By the magic of code img[‘caption’] will then return the caption in the right language. This worked for me with gallery and image fields. However, if you try to change your caption and such within the gallery-field in post-edit screen off a translation, you are only changing it’s default language data.
SO: If you have the WPML-Plugin installed and switch to a translation or create a new one, clear the gallery images and reselect them, WP will automaticaly provide you with the translated attachment-copys in the insert-media-box. Doing it in this “clean” manner will even enable you to edit the metadata within the acf-field for the currently selected language only.
Hope that help’s and is somewhat clear (english is not my mothertongue).
To Mr. Condon, thank you for this wonderfull piece of code!
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
📣 “ACF Chat Fridays”— Advanced Custom Fields (@wp_acf) January 31, 2023
The ACF team holds their first open office hours this Friday! Come and talk ACF, and ask questions about building sites with the plugin.
We’d love to see you there!
📆 Friday 3rd Feb - 3pm UTC
👉 Register here - https://t.co/3UtvQbE4CU pic.twitter.com/oTwW9K1XQ0
© 2023 Advanced Custom Fields.