Retrieves the translation of $text. If there is no translation, or the domain isn’t loaded, the original text is returned.

Signature

translate( $text, $domain = 'default' )
text
 (string) Text to translate.
domain
 (string) Domain to retrieve the translated text.
Default: 'default'

Return

(string) Translated text

Source

function translate( $text, $domain = 'default' ) {
	$translations = get_translations_for_domain( $domain );
	return apply_filters( 'gettext', $translations->translate( $text ), $text, $domain );
}
WP Trac GitHub Bitbucket

Link here