Snippet: Translate Any Plugin/Theme Text via Your Child Theme
add_filter( 'gettext', function( $translated_text, $text, $domain ) {
switch ( $translated_text ) {
case 'String 1' :
$translated_text = esc_html__( 'String 1', 'total' );
break;
case 'String 2' :
$translated_text = esc_html__( 'String 2', 'total' );
break;
case 'String 3' :
$translated_text = esc_html__( 'String 3', 'total' );
break;
}
return $translated_text;
}, 20, 3 );
All PHP snippets should be added via child theme's functions.php file or via a plugin (we recommend WPCode)