WPML taxonomy translation without post type translation

<?php
/** for WPML to display translated terms in a facet when
 ** the results for the query are a post type that is not set for translation
 ** change 'my_facet_name' for the facet you are using and 'my_taxonomy'
 ** to the name of your taxonomy
 **/

add_filter( 'facetwp_facet_display_value', function( $label, $params ) {
	if ( 'my_facet_name' == $params['facet']['name'] ) {
		$current = ( !empty( FWP()->facet->http_params['lang'] ) ) ? FWP()->facet->http_params['lang'] :  apply_filters( 'wpml_current_language', null );  
		$default = apply_filters('wpml_default_language', NULL );
		if ( $current != $default ) {
			$translated_id = apply_filters( 'wpml_object_id', $params['row']['term_id'], 'my_taxonomy', TRUE, $current );
			$term = get_term( $translated_id );
			var_dump( $term );
			if ( ! empty( $term ) ) {
				$label = esc_html( $term->name );
			}
		}        
	}
	return $label;
}, 10, 2 );

/** for fselects **/
add_filter( 'facetwp_facet_html', function( $output, $params ) {
	if ( 'my_facet_name' == $params['facet']['name'] ) {
	    $current = ( !empty( FWP()->facet->http_params['lang'] ) ) ? FWP()->facet->http_params['lang'] :  apply_filters( 'wpml_current_language', null );  
	    $default = apply_filters('wpml_default_language', NULL );
	    if ( $current != $default ) {
            preg_match_all( '/value="((\w|-)+)([^>])+>(([^<])+)/', $output, $matches );
            $default_values = [];
            $new_value s= [];
            foreach ( $matches[4] AS $match => $value ) {
                $term = get_term_by( 'slug', $matches[1][$match], 'my_taxonomy' );
                $translated_id = apply_filters( 'wpml_object_id', $term->term_id, 'my_taxonomy', TRUE, $current );
			    $translated_term = get_term( $translated_id );
                $default_values[] = $value;
                $new_values[] = $translated_term->name;
            }
            $output = str_replace( $default_values, $new_values, $output );
	    }	
	}
	
	return $output;
}, 10, 2 );