Translations::translate( string $singular, string $context = null ): string
Parameters
-
$singular
string Required -
-
$context
string Optional -
Default:
null
Return
string
Source
File: wp-includes/pomo/translations.php
.
View all references
public function translate( $singular, $context = null ) {
$entry = new Translation_Entry(
array(
'singular' => $singular,
'context' => $context,
)
);
$translated = $this->translate_entry( $entry );
return ( $translated && ! empty( $translated->translations ) ) ? $translated->translations[0] : $singular;
}