Support

Account

Home Forums General Issues Translating form field labels in frontend with Polylang Reply To: Translating form field labels in frontend with Polylang

  • Thanks, this was great find!

    I just went thru the the code of acf_form processing and came here to suggest a new hook, but you’ve found existing one!

    This works even if you don’t use Polylang, just make sure translations are in your .mo & .po files.

    add_filter('acf/prepare_field', function ($field) {
    	if (!is_admin()) {
    		$field['label'] = __($field['label'], 'textdomain' );
    	}
    	return $field;
    }, 10, 1);