W3cubDocs

/WordPress

Translations::select_plural_form( integer $count )

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

$count

(integer) (Required) number of items

Source

File: wp-includes/pomo/translations.php

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

© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/translations/select_plural_form