Support

Account

Home Forums Backend Issues (wp-admin) ACF Javascript API – Dynamically Update select2 Field Options Reply To: ACF Javascript API – Dynamically Update select2 Field Options

  • I forgot that you have to define the associated translations via normal PHP with:

    		acf_localize_text(array(
    			'the results could not be loaded.'	=> _x( 'The results could not be loaded.', 'Select2', 'picture-frame' ),
    			'please delete'						=> _x( 'Please delete', 'Select2', 'picture-frame' ),
    			'character'							=> _x( 'character', 'Select2', 'picture-frame' ),
    			'please enter'						=> _x( 'Please enter', 'Select2', 'picture-frame' ),
    			'or more characters'				=> _x( 'or more characters', 'Select2', 'picture-frame' ),
    			'loading more results…'				=> _x( 'Loading more results…', 'Select2', 'picture-frame' ),
    			'you can only select'				=> _x( 'You can only select', 'Select2', 'picture-frame' ),
    			'item'								=> _x( 'item', 'Select2', 'picture-frame' ),
    			'no results found'					=> _x( 'No results found', 'Select2', 'picture-frame' ),
    			'searching...'						=> _x( 'Searching...', 'Select2', 'picture-frame' ),
    			'remove all items'					=> _x( 'Remove all items', 'Select2', 'picture-frame' ),
    			'remove item'						=> _x( 'Remove item', 'Select2', 'picture-frame' ),
    			'search'							=> _x( 'Search', 'Select2', 'picture-frame' ),
    		));