Documentation ¶
Overview ¶
Package plurals is an easy-to-use wrapper around the /x/text/feature/plural package.
Plural rules controls how, for a given locale, plurals are counted in forms such as "1st", "2nd", "3rd", or "1 cat", "2 cats", etc.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Rules ¶
type Rules interface { // Ordinal is used to determine e.g. 0 days, 1 day, 2 days. For example, // for locale "en", Ordinal("2") == Many. Ordinal(number string) Form // Cardinal is used to determine e.g. 1st, 2nd, 3rd. For example, // for locale "en", Cardinal("3") == Few. Cardinal(number string) Form }
Rules implements plural forms of a number for a given locale.
Numbers represented by a string must be formatted with the ASCII digits '0' to '9', and optionally with a single decimal point encoded as the ASCII character '.'.
If an argument is of the wrong format, or out of range of an int64, the result will be Other.
Click to show internal directories.
Click to hide internal directories.