Changing s2member-list empty result text

I am using s2Member Pro for the first time. We have a place where we would like to display a list of users/members who are level 1 users. Sometimes, this list will be empty. Currently when this is the case, the text “Sorry, there are no users to list at this time.” is displayed. Is there any way to override this with different text?

Thanks for your help.

Put this in your (child) theme’s functions.php file or add an opening PHP tag and make it into an mu-plugin:

function kts_text_context_changes( $translated, $original, $context, $domain ) {
    if ( $domain == 's2member' && $context == 's2member-front' ) {
        if ( $original == 'Sorry, there are no users to list at this time.' ) {
            $translated = 'WHATEVER YOU WANT GOES HERE';
        }
        else if ( $original == 'SOME OTHER STRING TO CHANGE' ) {
		$translated = 'YOUR NEW PREFERRED TEXT';
	}
    }
    return $translated; // return modified text
}
add_filter( 'gettext_with_context', 'kts_text_context_changes', 10, 4 );

As you can see, you can make an infinitely long list of textual changes if you so desire.

Works like a charm! Thanks so much!