Skip to content

Commit

Permalink
update deps and migrate to a new gettext version
Browse files Browse the repository at this point in the history
  • Loading branch information
anmarchenko committed Sep 21, 2024
1 parent c4d1468 commit c675c57
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 31 deletions.
2 changes: 1 addition & 1 deletion lib/hamster_travel/packing/packing.ex
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ defmodule HamsterTravel.Packing do
require Logger

import Ecto.Query, warn: false
import HamsterTravelWeb.Gettext
use Gettext, backend: HamsterTravelWeb.Gettext

alias HamsterTravel.EctoOrdered
alias HamsterTravel.Packing.Policy
Expand Down
4 changes: 2 additions & 2 deletions lib/hamster_travel_web.ex
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ defmodule HamsterTravelWeb do
layouts: [html: HamsterTravelWeb.Layouts]

import Plug.Conn
import HamsterTravelWeb.Gettext
use Gettext, backend: HamsterTravelWeb.Gettext

unquote(verified_routes())
end
Expand Down Expand Up @@ -86,7 +86,7 @@ defmodule HamsterTravelWeb do
import Phoenix.HTML
# Core UI components and translation
import HamsterTravelWeb.CoreComponents
import HamsterTravelWeb.Gettext
use Gettext, backend: HamsterTravelWeb.Gettext

# use PETAL components
import PetalComponents.Alert
Expand Down
2 changes: 1 addition & 1 deletion lib/hamster_travel_web/components/core_components.ex
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ defmodule HamsterTravelWeb.CoreComponents do
use HamsterTravelWeb, :verified_routes

import PetalComponents.Icon
import HamsterTravelWeb.Gettext
use Gettext, backend: HamsterTravelWeb.Gettext

alias Phoenix.LiveView.JS

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ defmodule HamsterTravelWeb.UserSessionController do
alias HamsterTravel.Accounts
alias HamsterTravelWeb.UserAuth

import HamsterTravelWeb.Gettext
use Gettext, backend: HamsterTravelWeb.Gettext

def create(conn, %{"_action" => "registered"} = params) do
create(conn, params, gettext("Account created successfully!"))
Expand Down
4 changes: 2 additions & 2 deletions lib/hamster_travel_web/gettext.ex
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ defmodule HamsterTravelWeb.Gettext do
By using [Gettext](https://hexdocs.pm/gettext),
your module gains a set of macros for translations, for example:
import HamsterTravelWeb.Gettext
use Gettext, backend: HamsterTravelWeb.Gettext
# Simple translation
gettext("Here is the string to translate")
Expand All @@ -20,5 +20,5 @@ defmodule HamsterTravelWeb.Gettext do
See the [Gettext Docs](https://hexdocs.pm/gettext) for detailed usage.
"""
use Gettext, otp_app: :hamster_travel
use Gettext.Backend, otp_app: :hamster_travel
end
2 changes: 1 addition & 1 deletion lib/hamster_travel_web/live/home.ex
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ defmodule HamsterTravelWeb.Home do
"""
use HamsterTravelWeb, :live_view

import HamsterTravelWeb.Gettext
use Gettext, backend: HamsterTravelWeb.Gettext
import HamsterTravelWeb.Planning.Grid

alias HamsterTravel.Planning
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ defmodule HamsterTravelWeb.Packing.IndexBackpacks do
"""
use HamsterTravelWeb, :live_view

import HamsterTravelWeb.Gettext
use Gettext, backend: HamsterTravelWeb.Gettext
import HamsterTravelWeb.Packing.Backpacks.Grid

alias HamsterTravel.Packing
Expand Down
2 changes: 1 addition & 1 deletion lib/hamster_travel_web/user_auth.ex
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
defmodule HamsterTravelWeb.UserAuth do
use HamsterTravelWeb, :verified_routes

import HamsterTravelWeb.Gettext
use Gettext, backend: HamsterTravelWeb.Gettext
import Phoenix.Controller
import Plug.Conn

Expand Down
42 changes: 21 additions & 21 deletions mix.lock

Large diffs are not rendered by default.

0 comments on commit c675c57

Please sign in to comment.