gettext.ex 696 B

12345678910111213141516171819202122232425
  1. defmodule WebWeb.Gettext do
  2. @moduledoc """
  3. A module providing Internationalization with a gettext-based API.
  4. By using [Gettext](https://hexdocs.pm/gettext),
  5. your module gains a set of macros for translations, for example:
  6. import WebWeb.Gettext
  7. # Simple translation
  8. gettext "Here is the string to translate"
  9. # Plural translation
  10. ngettext "Here is the string to translate",
  11. "Here are the strings to translate",
  12. 3
  13. # Domain-based translation
  14. dgettext "errors", "Here is the error message to translate"
  15. See the [Gettext Docs](https://hexdocs.pm/gettext) for detailed usage.
  16. """
  17. use Gettext, otp_app: :web
  18. end