Change default label in sort facet when using a search facet to show relevance is now the sort

/** change 'Default sort' to the text of your Default label setting of your search facet, be sure to match exactly including case
 ** change 'my_search_facet' to the name of your search facet (2 places)
 ** change 'Relevance' to whatever you want the default label to be when using a search facet
add_filter( 'facetwp_i18n', function( $text ) {
    if ( 'Default sort' == $text && isset( FWP()->facet->facets['my_search_facet']['selected_values'] ) && !empty( FWP()->facet->facets['search']['selected_values'] )  ) {
        return 'Relevance';
    return $text;