Used By
| Used By | Description |
|---|---|
| wp-includes/pomo/translations.php: Gettext_Translations::gettext_select_plural_form() | The gettext implementation of select_plural_form. |
| wp-includes/pomo/translations.php: Gettext_Translations::set_header() |
(string) (Required)
(array)
File: wp-includes/pomo/translations.php
function nplurals_and_expression_from_header( $header ) {
if ( preg_match( '/^\s*nplurals\s*=\s*(\d+)\s*;\s+plural\s*=\s*(.+)$/', $header, $matches ) ) {
$nplurals = (int) $matches[1];
$expression = trim( $matches[2] );
return array( $nplurals, $expression );
} else {
return array( 2, 'n != 1' );
}
}
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/gettext_translations/nplurals_and_expression_from_header