I use code snippets to display messages in my site, for example, next to the "Post Comment" button I display the text "Your message will only be visible after manual moderation". I use this code for that:
add_action( 'comment_form', 'wpse_93795_comment_form' );
function wpse_93795_comment_form( $post_id ) {
printf( '<span class="submit-comment-note">%s</span>',
__( 'Your message will only be visible after manual moderation', 'your_text_domain' ) );
}
My question is: Can have a "switch" here to write a text depending on the language?
For example, if the language set in the site is English I want to display ‘Your message will only be visible after manual moderation’
But if language is Spanish I want to display "Su mensaje sólo será visible tras ser manualmente revisado"
I use Polylang for having different languages in the site.
Thanks