Just tagging along. I’m also curious on ways to translate ‘select’ Field Type properly.
edit: I’ve resolved my issue, let’s see if it can help with yours. First let’s see if I understand properly what you want to do. You have a site where posts are a person’s profile. One of the ACF field for the post is their eye color. Your main language is Dutch, second English.
You want people/user to create a post in Dutch, add a Title/name and Content/description, then select eye color. You want the user to then create the translation in english, translate the name and description, but have the selected eye color sync. You want the labels for the eye color translated.
Here is how I made it work for me.
(ps. all ACF group fields created before WPML install are buggy AFAIK, create new ones)
Create a new ACF group field in dutch with a ‘select’ field for the eye color (eye_color) with such value:
blue : blauw
brown : bruin
Create translation in english using duplicate. Make separate. Keep Field name but edit ‘select’ values to:
blue : blue
brown : brown
Create a new post. add Dutch content. Publish. In ‘Multilingual Content Setup’ set ‘eye_color’ to Copy. Save. Update.
Create English translation using Duplicate. Make separate. Edit Title/name and Content/description to English text. Eye color label should be in english, and frontend should display correct value in english.
I use this code to display the label :
$field = get_field_object('eye_color'); $value = $field['value']; $label = $field['choices'][ $value ]; echo $label;
Bugs: Editing the eye_color field in the English post doesn’t work. Modifications needs to be done in the original language. If this feature can’t be added, field should greyed out imo.
Let me know if that helps you.
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!
We've just released ACF 5.12.3 with a security fix to prevent arbitrary file uploads to forms with ACF fields.— Advanced Custom Fields (@wp_acf) July 14, 2022
Now that we've released this update, we recommend updating your sites as soon as possible.
© 2022 Advanced Custom Fields.