gettext.ex 723 B

123456789101112131415161718192021222324
  1. defmodule FourlettersWeb.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 FourlettersWeb.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: :fourletters
  18. end