Y18N v1.0.0 Orisons.Y18N.Plural behaviour View Source

Link to this section Summary

Functions

Get plural module by language shortcut

Determinates plural variant based on count and lang

Keyword list of modules where key is language shortcut

Callbacks

Return variant of plural based on integer

Inform about amount of vartiants that can be returned by check/1

Link to this section Functions

Get plural module by language shortcut

Example:

iex> Orisons.Y18N.Plural.get_plural(:en)
{:ok, Orisons.Y18N.Plural.En}

Same as Orisons.Y18N.Plural.get_plural/1, but if language is not defined will throw Orisons.Y18N.Plural.LanguageException

Link to this function get_plural_count(count, lang) View Source

Determinates plural variant based on count and lang

Example:

iex> Orisons.Y18N.Plural.get_plural_count(1, :pl)
"a"

Keyword list of modules where key is language shortcut

Link to this section Callbacks

Link to this callback check(integer) View Source
check(integer()) :: binary()

Return variant of plural based on integer

Link to this callback variants() View Source
variants() :: integer()

Inform about amount of vartiants that can be returned by check/1