View Source Cldr.Gettext.Plural (Cldr v2.38.0)
Implements a macro to define a CLDR-based Gettext plural module
gettext allows for user-defined plural forms modules to be configured for a gettext backend.
To define a plural forms module that uses CLDR plural rules
create a new module and then use Cldr.Gettext.Plural
. For example:
defmodule MyApp.Gettext.Plural do
use Cldr.Gettext.Plural, cldr_backend: MyApp.Cldr
end
This module can then be used in the configuration of a gettext
backend.
For example:
defmodule MyApp.Gettext do
use Gettext, plural_forms: MyApp.Gettext.Plural
end
Summary
Functions
Configure a module to be a gettext plural module.
Functions
Configure a module to be a gettext plural module.
A CLDR-based gettext
plural module is defined by including use Cldr.Gettext.Plural
as in this example:
defmodule MyApp.Gettext.Plural do
use Cldr.Gettext.Plural, cldr_backend: MyApp.Cldr
end
Arguments
options
is a keyword list of options. The default is[]
Options
:cldr_backend
is any CLDR backend module. The default isCldr.default_backend!/0
.