diff --git a/lib/live_beats_web.ex b/lib/live_beats_web.ex index 7263d0b..2e4ad2a 100644 --- a/lib/live_beats_web.ex +++ b/lib/live_beats_web.ex @@ -21,13 +21,14 @@ defmodule LiveBeatsWeb do def controller do quote do + use Gettext, backend: LiveBeatsWeb.Gettext + use Phoenix.Controller, namespace: LiveBeatsWeb, formats: [:html, :json], layouts: [html: LiveBeatsWeb.Layouts] import Plug.Conn - import LiveBeatsWeb.Gettext alias LiveBeatsWeb.Router.Helpers, as: Routes unquote(verified_routes()) end @@ -92,8 +93,8 @@ defmodule LiveBeatsWeb do def channel do quote do + use Gettext, backend: LiveBeatsWeb.Gettext use Phoenix.Channel - import LiveBeatsWeb.Gettext end end @@ -102,10 +103,10 @@ defmodule LiveBeatsWeb do # Use all HTML functionality (forms, tags, etc) import Phoenix.HTML import Phoenix.HTML.Form + use Gettext, backend: LiveBeatsWeb.Gettext use PhoenixHTMLHelpers import LiveBeatsWeb.CoreComponents - import LiveBeatsWeb.Gettext alias LiveBeatsWeb.Router.Helpers, as: Routes alias Phoenix.LiveView.JS unquote(verified_routes()) diff --git a/lib/live_beats_web/gettext.ex b/lib/live_beats_web/gettext.ex index 7df7c60..e11aeac 100644 --- a/lib/live_beats_web/gettext.ex +++ b/lib/live_beats_web/gettext.ex @@ -5,7 +5,7 @@ defmodule LiveBeatsWeb.Gettext do By using [Gettext](https://hexdocs.pm/gettext), your module gains a set of macros for translations, for example: - import LiveBeatsWeb.Gettext + use Gettext, backend: LiveBeatsWeb.Gettext # Simple translation gettext("Here is the string to translate") @@ -20,5 +20,5 @@ defmodule LiveBeatsWeb.Gettext do See the [Gettext Docs](https://hexdocs.pm/gettext) for detailed usage. """ - use Gettext, otp_app: :live_beats + use Gettext.Backend, otp_app: :live_beats end