WordPress at a glance
function is not described

Translations::translate() public WP 1.0

{} It's a method of the class: Translations{}

No Hooks.

Return

String. Null. Nothing.

Usage

$Translations = new Translations();
$Translations->translate( $singular, $context );
$singular(string) (required)
-
$context(string)
-

Code of Translations::translate() WP 5.7

<?php
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;
}