Files
Claudio Ortolina 8255e50e1d Address gettext deprecations
Deprecation warning:

	warning: defining a Gettext backend by calling

	    use Gettext, otp_app: ...

	is deprecated. To define a backend, call:

	    use Gettext.Backend, otp_app: :my_app

	Then, instead of importing your backend, call this in your module:

	    use Gettext, backend: MyApp.Gettext
2024-09-12 14:13:06 +01:00

25 lines
735 B
Elixir

defmodule MusicLibraryWeb.Gettext do
@moduledoc """
A module providing Internationalization with a gettext-based API.
By using [Gettext](https://hexdocs.pm/gettext),
your module gains a set of macros for translations, for example:
import MusicLibraryWeb.Gettext
# Simple translation
gettext("Here is the string to translate")
# Plural translation
ngettext("Here is the string to translate",
"Here are the strings to translate",
3)
# Domain-based translation
dgettext("errors", "Here is the error message to translate")
See the [Gettext Docs](https://hexdocs.pm/gettext) for detailed usage.
"""
use Gettext.Backend, otp_app: :music_library
end