fix: adjust gettext usage
All checks were successful
continuous-integration/drone/pr Build is passing
All checks were successful
continuous-integration/drone/pr Build is passing
The new version of [`Gettext`][0] changed the way it's used, to avoid large penalties when recompiling large projects. [0]: https://github.com/elixir-gettext/gettext/blob/main/CHANGELOG.md#v0260
This commit is contained in:
parent
743825d583
commit
796bc056a4
@ -19,10 +19,10 @@ defmodule WabanexWeb do
|
||||
|
||||
def controller do
|
||||
quote do
|
||||
use Gettext, backend: WabanexWeb.Gettext
|
||||
use Phoenix.Controller, namespace: WabanexWeb
|
||||
|
||||
import Plug.Conn
|
||||
import WabanexWeb.Gettext
|
||||
alias WabanexWeb.Router.Helpers, as: Routes
|
||||
end
|
||||
end
|
||||
@ -54,17 +54,18 @@ defmodule WabanexWeb do
|
||||
def channel do
|
||||
quote do
|
||||
use Phoenix.Channel
|
||||
import WabanexWeb.Gettext
|
||||
use Gettext, backend: WabanexWeb.Gettext
|
||||
end
|
||||
end
|
||||
|
||||
defp view_helpers do
|
||||
quote do
|
||||
use Gettext, backend: WabanexWeb.Gettext
|
||||
|
||||
# Import basic rendering functionality (render, render_layout, etc)
|
||||
import Phoenix.View
|
||||
|
||||
import WabanexWeb.ErrorHelpers
|
||||
import WabanexWeb.Gettext
|
||||
alias WabanexWeb.Router.Helpers, as: Routes
|
||||
end
|
||||
end
|
||||
|
@ -5,7 +5,7 @@ defmodule WabanexWeb.Gettext do
|
||||
By using [Gettext](https://hexdocs.pm/gettext),
|
||||
your module gains a set of macros for translations, for example:
|
||||
|
||||
import WabanexWeb.Gettext
|
||||
use Gettext, backend: WabanexWeb.Gettext
|
||||
|
||||
# Simple translation
|
||||
gettext("Here is the string to translate")
|
||||
@ -20,5 +20,5 @@ defmodule WabanexWeb.Gettext do
|
||||
|
||||
See the [Gettext Docs](https://hexdocs.pm/gettext) for detailed usage.
|
||||
"""
|
||||
use Gettext, otp_app: :wabanex
|
||||
use Gettext.Backend, otp_app: :wabanex
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user