Cldr.Gettext.Plural (Cldr v2.28.0) View Source

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

Link to this section Summary

Functions

Configure a module to be a gettext plural module.

Link to this section Functions

Link to this macro

__using__(opts \\ [])

View Source (macro)

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