Translates a singular string.
Parameters
$singularstring|nullrequired- Singular string.
$contextstring|nulloptional- Context.
Default:
''
Source
public function translate( $singular, $context = '' ) {
if ( null === $singular ) {
return null;
}
$translation = $this->controller->translate( $singular, (string) $context, $this->textdomain );
if ( false !== $translation ) {
return $translation;
}
// Fall back to the original.
return $singular;
}
Changelog
| Version | Description |
|---|---|
| 6.5.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.