Translations::select_plural_form( int $count ): int

Given the number of items, returns the 0-based index of the plural form to use

Description

Here, in the base Translations class, the common logic for English is implemented: 0 if there is one element, 1 otherwise

This function should be overridden by the subclasses. For example MO/PO can derive the logic from their headers.

Parameters

$countintrequired
Number of items.

Return

int Plural form to use.

Source

public function select_plural_form( $count ) {
	return 1 === (int) $count ? 0 : 1;
}

Changelog

VersionDescription
2.8.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.