Home › Forums › General Issues › translate choices of radio/select/checkbox fields › Reply To: translate choices of radio/select/checkbox fields
Hi @renar
The the_field() function will only show the value of the selected choice, not the label. Could you please check the var_dump() result on the Hebrew page? Please keep in mind that the translated page has a different ID than the original page. If the choices show the Hebrew label, then you can show the label like this:
<?php
$field = get_field_object('field_name');
$value = get_field('field_name');
$label = $field['choices'][ $value ];
?>
<p>Color: <?php echo $label; ?></p>
Please check the link I gave you before to learn more about it.
If it doesn’t show the Hebrew label, could you please var_dump() it without the ID of the page like the following?
echo "<pre>";
$select_object = get_field_object('select_field_name');
var_dump($select_object);
echo "</pre>";
If still no joy, I’m afraid you need to translate it by using WordPress localization functions. This page should give you more idea about it: https://codex.wordpress.org/I18n_for_WordPress_Developers.
Hope this helps 🙂
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 use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.