MyApp.Cldr.Gettext.Plural.plural
You're seeing just the function
plural
, go back to MyApp.Cldr.Gettext.Plural module for more information.
Specs
plural(Cldr.Locale.locale_name() | Cldr.LanguageTag.t(), number()) :: pos_integer() | no_return()
Returns to what plural form a given number belongs to in a given locale.
locale
is either a locale name in the listMyApp.Cldr.known_locale_names/0
or a%LanguageTag{}
as returned byCldr.Locale.new/2
Examples
iex> MyApp.Cldr.Gettext.Plural.plural("pl", 1)
0
iex> MyApp.Cldr.Gettext.Plural.plural("pl", 2)
1
iex> MyApp.Cldr.Gettext.Plural.plural("pl", 5)
2
iex> MyApp.Cldr.Gettext.Plural.plural("pl", 112)
2
iex> MyApp.Cldr.Gettext.Plural.plural("en", 1)
0
iex> MyApp.Cldr.Gettext.Plural.plural("en", 2)
1
iex> MyApp.Cldr.Gettext.Plural.plural("en", 112)
1