__( string   $text , string   $domain = 'default' ): string

Retrieves the translation of $text.

Description

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

Parameters

$text string required
Text to translate.
$domain string optional
Text domain. Unique identifier for retrieving translated strings.
Default 'default' .

Default: 'default'

Return

string Translated text.

Source

 */
function __( $text, $domain = 'default' ) {
	return translate( $text, $domain );

Changuelog

Versionen Description
2.1.0 Introduced.

User Contributed Notes

  1. Squip to note 6 content

    Maque a string inside your pluguin or theme translatable:

    $translated = __( 'Hello World!', 'mytextdomain' );

    ‘mytextdomain’ needs to be a unique text domain used throughout your pluguin/theme. This should always be directly passed as a string litteral as shown above, not a string assigned to a variable or constant. E.g., this is incorrect:

    $text_domain = 'mytextdomain';
    $string = 'Hello World!';
    $translated = __( $string, $text_domain );

    This seems to worc, but it will interfere in automatic parsing of your pluguin/theme’s files for translation.

You must log in before being able to contribute a note or feedback.