diff --git a/lib/teslamate_web.ex b/lib/teslamate_web.ex index 19a134b2..03ef6e2f 100644 --- a/lib/teslamate_web.ex +++ b/lib/teslamate_web.ex @@ -27,7 +27,7 @@ defmodule TeslaMateWeb do use Phoenix.Controller, namespace: TeslaMateWeb import Plug.Conn - import TeslaMateWeb.Gettext + use Gettext, backend: TeslaMateWeb.Gettext alias TeslaMateWeb.Router.Helpers, as: Routes unquote(verified_routes()) @@ -79,14 +79,16 @@ defmodule TeslaMateWeb do def channel do quote do use Phoenix.Channel - import TeslaMateWeb.Gettext + use Gettext, backend: TeslaMateWeb.Gettext end end defp view_helpers do quote do - # Use all HTML functionality (forms, tags, etc) - use Phoenix.HTML + # Import all HTML functionality (forms, tags, etc) + import Phoenix.HTML + import Phoenix.HTML.Form + use PhoenixHTMLHelpers # Import convenience functions for LiveView rendering import Phoenix.LiveView.Helpers @@ -94,7 +96,7 @@ defmodule TeslaMateWeb do import Phoenix.View import TeslaMateWeb.ErrorHelpers - import TeslaMateWeb.Gettext + use Gettext, backend: TeslaMateWeb.Gettext alias TeslaMateWeb.Router.Helpers, as: Routes unquote(verified_routes()) diff --git a/lib/teslamate_web/gettext.ex b/lib/teslamate_web/gettext.ex index 2ca985dc..3eb139dc 100644 --- a/lib/teslamate_web/gettext.ex +++ b/lib/teslamate_web/gettext.ex @@ -5,7 +5,7 @@ defmodule TeslaMateWeb.Gettext do By using [Gettext](https://hexdocs.pm/gettext), your module gains a set of macros for translations, for example: - import TeslaMateWeb.Gettext + use Gettext, backend: TeslaMateWeb.Gettext # Simple translation gettext("Here is the string to translate") @@ -20,5 +20,5 @@ defmodule TeslaMateWeb.Gettext do See the [Gettext Docs](https://hexdocs.pm/gettext) for detailed usage. """ - use Gettext, otp_app: :teslamate + use Gettext.Backend, otp_app: :teslamate end diff --git a/lib/teslamate_web/live/car_live/summary.ex b/lib/teslamate_web/live/car_live/summary.ex index e2412220..b2f98b43 100644 --- a/lib/teslamate_web/live/car_live/summary.ex +++ b/lib/teslamate_web/live/car_live/summary.ex @@ -1,7 +1,7 @@ defmodule TeslaMateWeb.CarLive.Summary do use TeslaMateWeb, :live_view - import TeslaMateWeb.Gettext + use Gettext, backend: TeslaMateWeb.Gettext alias TeslaMate.Vehicles.Vehicle.Summary alias TeslaMate.Vehicles.Vehicle diff --git a/lib/teslamate_web/live/charge_live/cost.ex b/lib/teslamate_web/live/charge_live/cost.ex index c53a9b61..810d0bf4 100644 --- a/lib/teslamate_web/live/charge_live/cost.ex +++ b/lib/teslamate_web/live/charge_live/cost.ex @@ -7,7 +7,7 @@ defmodule TeslaMateWeb.ChargeLive.Cost do alias TeslaMate.Log.ChargingProcess alias TeslaMate.Log - import TeslaMateWeb.Gettext + use Gettext, backend: TeslaMateWeb.Gettext on_mount {TeslaMateWeb.InitAssigns, :locale} diff --git a/lib/teslamate_web/live/charge_live/cost.html.heex b/lib/teslamate_web/live/charge_live/cost.html.heex index 0c15e8b4..ba25a1aa 100644 --- a/lib/teslamate_web/live/charge_live/cost.html.heex +++ b/lib/teslamate_web/live/charge_live/cost.html.heex @@ -1,7 +1,7 @@ diff --git a/lib/teslamate_web/live/geofence_live/form.ex b/lib/teslamate_web/live/geofence_live/form.ex index 90c5f1db..87b762cd 100644 --- a/lib/teslamate_web/live/geofence_live/form.ex +++ b/lib/teslamate_web/live/geofence_live/form.ex @@ -161,7 +161,7 @@ defmodule TeslaMateWeb.GeoFenceLive.Form do socket |> assign(geofence: geofence) |> put_flash(:success, flash_msg(action, name)) - |> push_redirect(to: Routes.live_path(socket, GeoFenceLive.Index)) + |> push_navigate(to: Routes.live_path(socket, GeoFenceLive.Index)) {:ok, socket} end diff --git a/lib/teslamate_web/live/geofence_live/form.html.heex b/lib/teslamate_web/live/geofence_live/form.html.heex index 245c84c8..9498c4ed 100644 --- a/lib/teslamate_web/live/geofence_live/form.html.heex +++ b/lib/teslamate_web/live/geofence_live/form.html.heex @@ -1,7 +1,7 @@