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 3 voices.

Last updated by josefS-12 1 year, 5 months ago.

Assigned support staff: Shekhar Bhandari.

Author Posts
May 1, 2018 at 9:48 pm #1918201

alfredK-2

In ACF there is the option to have Choices:
----
Enter each choice on a new line.
For more control, you may specify both a value and label like this:
red : Red
blue : Blue
----

We like to use your WPML Translator Manager, however we don't know how to only get those choices translated (the output/selected items are all the same in all language except different written), we can't find them anywhere? It seems we can translate the whole Field Group, which we did now (by your document), but then we need to manually write all the choices options in the field. Also we can't assign it to some translator through the WPML, but only an admin can do this.

In theory we only need to Translate the Choices:
"red: Red" in Dutch that would be "red: Rood"

May 3, 2018 at 12:02 pm #1956574

Shekhar Bhandari
Supporter

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello there,

Thank you for contacting WPML support. I'd be happy to assist you further on this issue.

Currently to display the translation of the choices on the front-end you can use the following method

$field = get_field_object('fieldname');
$value = $field['value'];
$label = $field['choices'][ $value ];
echo __($label, 'textdomain');
echo '<br/>';

Now go to string translation and translate the string accordingly.

Let me know if this helps.

Thanks

May 3, 2018 at 1:29 pm #1958503

josefS-12

I am solving this too...
Where should I put this code? There is no inbuild feature do this?

Thanks.

The topic ‘[Closed] How to only translate the ACF Choices?’ is closed to new replies.