Translations::translate()
最后更新于:2021-11-26 04:56:20
Translations::translate( string$singular, string$context=null)参数
- $singular
-
(string) (Required)
- $context
-
(string) (Optional)
Default value: null
响应
(string)
源文件
文件: gc-includes/pomo/translations.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;
}