Gettext_Translations::nplurals_and_expression_from_header()
最后更新于:2021-11-25 19:52:17
Gettext_Translations::nplurals_and_expression_from_header( string$header)参数
- $header
-
(string) (Required)
响应
(array)
源文件
文件: gc-includes/pomo/translations.php
function nplurals_and_expression_from_header( $header ) {
if ( preg_match( '/^s*npluralss*=s*(d+)s*;s+plurals*=s*(.+)$/', $header, $matches ) ) {
$nplurals = (int) $matches[1];
$expression = trim( $matches[2] );
return array( $nplurals, $expression );
} else {
return array( 2, 'n != 1' );
}
}