Q: How enable multilingual support for the repeater select
field of the Advanced Custom Fields plugin?
A:
For example, let’s name the Repeater as "our_tabs"
, and the sub-field Select as "tab_name"
.
1. Fill in the attribute "Choices"
of the "tab_name"
field:
2. To output the attribute value on a page, add to the template the code below (example):
if( have_rows('our_tabs') ):
while( have_rows('our_tabs') ) : the_row();
$tab_name = get_sub_field_object('tab_name');
$tab_name_value = WPGlobus_Core::text_filter( $tab_name['value'], WPGlobus::Config()->language );
// To get the `$tab_name_choice` value in the current language:
$tab_name_choice = $tab_name['choices'][$tab_name_value] =
WPGlobus_Core::text_filter( $tab_name['choices'][$tab_name_value],
WPGlobus::Config()->language );
// To output the `$tab_name_choice` value in the current language:
echo $tab_name_choice;
endwhile;
endif;
Or use the code example from
https://www.advancedcustomfields.com/resources/dynamically-populate-a-select-fields-choices