Gettext_Translations::nplurals_and_expression_from_header

Advertisement

Syntax Syntax

Gettext_Translations::nplurals_and_expression_from_header( string $header )

Parameters Parameters

$header

(string) (Required)

Return Return

(array)

Source Source

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' );
			}
		}

Advertisement

Advertisement

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.