fix: Fix gettext usage warning (#10693)

pull/10695/head
Victor Baranov 3 months ago committed by GitHub
parent 1a179bb855
commit 22f3ff9943
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 7
      apps/block_scout_web/lib/block_scout_web.ex
  2. 2
      apps/block_scout_web/lib/block_scout_web/gettext.ex
  3. 2
      apps/block_scout_web/lib/block_scout_web/views/block_transaction_view.ex
  4. 2
      apps/block_scout_web/lib/block_scout_web/views/internal_transaction_view.ex
  5. 2
      apps/block_scout_web/lib/block_scout_web/views/transaction_view.ex
  6. 2
      apps/block_scout_web/lib/block_scout_web/views/wei_helper.ex

@ -25,7 +25,7 @@ defmodule BlockScoutWeb do
import BlockScoutWeb.Controller import BlockScoutWeb.Controller
import BlockScoutWeb.Router.Helpers import BlockScoutWeb.Router.Helpers
import BlockScoutWeb.Routers.WebRouter.Helpers, except: [static_path: 2] import BlockScoutWeb.Routers.WebRouter.Helpers, except: [static_path: 2]
import BlockScoutWeb.Gettext use Gettext, backend: BlockScoutWeb.Gettext
import BlockScoutWeb.ErrorHelper import BlockScoutWeb.ErrorHelper
import BlockScoutWeb.Routers.AccountRouter.Helpers, except: [static_path: 2] import BlockScoutWeb.Routers.AccountRouter.Helpers, except: [static_path: 2]
import Plug.Conn import Plug.Conn
@ -49,7 +49,6 @@ defmodule BlockScoutWeb do
import BlockScoutWeb.{ import BlockScoutWeb.{
CurrencyHelper, CurrencyHelper,
ErrorHelper, ErrorHelper,
Gettext,
Router.Helpers, Router.Helpers,
TabHelper, TabHelper,
Tokens.Helper, Tokens.Helper,
@ -57,6 +56,8 @@ defmodule BlockScoutWeb do
WeiHelper WeiHelper
} }
use Gettext, backend: BlockScoutWeb.Gettext
import BlockScoutWeb.Routers.AccountRouter.Helpers, except: [static_path: 2] import BlockScoutWeb.Routers.AccountRouter.Helpers, except: [static_path: 2]
import Explorer.Chain.CurrencyHelper, only: [divide_decimals: 2] import Explorer.Chain.CurrencyHelper, only: [divide_decimals: 2]
@ -78,7 +79,7 @@ defmodule BlockScoutWeb do
quote do quote do
use Phoenix.Channel use Phoenix.Channel
import BlockScoutWeb.Gettext use Gettext, backend: BlockScoutWeb.Gettext
end end
end end

@ -20,5 +20,5 @@ defmodule BlockScoutWeb.Gettext do
See the [Gettext Docs](https://hexdocs.pm/gettext) for detailed usage. See the [Gettext Docs](https://hexdocs.pm/gettext) for detailed usage.
""" """
use Gettext, otp_app: :block_scout_web use Gettext.Backend, otp_app: :block_scout_web
end end

@ -1,7 +1,7 @@
defmodule BlockScoutWeb.BlockTransactionView do defmodule BlockScoutWeb.BlockTransactionView do
use BlockScoutWeb, :view use BlockScoutWeb, :view
import BlockScoutWeb.Gettext, only: [gettext: 1] use Gettext, backend: BlockScoutWeb.Gettext
def block_not_found_message({:ok, true}) do def block_not_found_message({:ok, true}) do
gettext("Easy Cowboy! This block does not exist yet!") gettext("Easy Cowboy! This block does not exist yet!")

@ -3,7 +3,7 @@ defmodule BlockScoutWeb.InternalTransactionView do
alias Explorer.Chain.InternalTransaction alias Explorer.Chain.InternalTransaction
import BlockScoutWeb.Gettext use Gettext, backend: BlockScoutWeb.Gettext
@doc """ @doc """
Returns the formatted string for the type of the internal transaction. Returns the formatted string for the type of the internal transaction.

@ -11,7 +11,7 @@ defmodule BlockScoutWeb.TransactionView do
alias Explorer.ExchangeRates.Token alias Explorer.ExchangeRates.Token
alias Timex.Duration alias Timex.Duration
import BlockScoutWeb.Gettext use Gettext, backend: BlockScoutWeb.Gettext
import BlockScoutWeb.AddressView, only: [from_address_hash: 1, short_token_id: 2, tag_name_to_label: 1] import BlockScoutWeb.AddressView, only: [from_address_hash: 1, short_token_id: 2, tag_name_to_label: 1]
import BlockScoutWeb.Tokens.Helper import BlockScoutWeb.Tokens.Helper

@ -3,7 +3,7 @@ defmodule BlockScoutWeb.WeiHelper do
Helper functions for interacting with `t:Explorer.Chain.Wei.t/0` values. Helper functions for interacting with `t:Explorer.Chain.Wei.t/0` values.
""" """
import BlockScoutWeb.Gettext use Gettext, backend: BlockScoutWeb.Gettext
alias BlockScoutWeb.CldrHelper alias BlockScoutWeb.CldrHelper
alias Explorer.Chain.Wei alias Explorer.Chain.Wei

Loading…
Cancel
Save