fix CLDR issues

pull/2473/head
Ayrat Badykov 5 years ago
parent 761fb05256
commit 2a5c63b5e5
No known key found for this signature in database
GPG Key ID: B44668E265E9396F
  1. 2
      apps/block_scout_web/lib/block_scout_web/channels/address_channel.ex
  2. 4
      apps/block_scout_web/lib/block_scout_web/templates/address/overview.html.eex
  3. 4
      apps/block_scout_web/lib/block_scout_web/templates/block/overview.html.eex
  4. 6
      apps/block_scout_web/lib/block_scout_web/templates/chain/show.html.eex
  5. 2
      apps/block_scout_web/lib/block_scout_web/views/address_view.ex
  6. 4
      apps/block_scout_web/lib/block_scout_web/views/block_view.ex
  7. 2
      apps/block_scout_web/lib/block_scout_web/views/transaction_view.ex

@ -73,7 +73,7 @@ defmodule BlockScoutWeb.AddressChannel do
def handle_out("count", %{count: count}, socket) do
Gettext.put_locale(BlockScoutWeb.Gettext, socket.assigns.locale)
push(socket, "count", %{count: Cldr.Number.to_string!(count, format: "#,###")})
push(socket, "count", %{count: BlockScoutWeb.Cldr.Number.to_string!(count, format: "#,###")})
{:noreply, socket}
end

@ -79,7 +79,7 @@
<%= gettext("Incoming Transactions") %>
<% else %>
<span data-selector="transaction-count">
<%= Cldr.Number.to_string!(@transaction_count, format: "#,###") %>
<%= BlockScoutWeb.Cldr.Number.to_string!(@transaction_count, format: "#,###") %>
</span>
<%= gettext("Transactions Sent") %>
<% end %>
@ -92,7 +92,7 @@
<%= if validator?(@validation_count) do %>
<span class="address-detail-item">
<span data-selector="validation-count">
<%= Cldr.Number.to_string!(@validation_count, format: "#,###") %>
<%= BlockScoutWeb.Cldr.Number.to_string!(@validation_count, format: "#,###") %>
</span>
<%= gettext("Blocks Validated") %>
</span>

@ -98,7 +98,7 @@
<dt class="col-sm-3 text-muted"><%= gettext "Gas Used" %></dt>
<dd class="col-sm-9">
<span><%= @block.gas_used |> Cldr.Number.to_string! %></span>
<span class="text-muted">(<%= (Decimal.to_integer(@block.gas_used) / Decimal.to_integer(@block.gas_limit)) |> Cldr.Number.to_string!(format: "#.#%") %>)</span>
<span class="text-muted">(<%= (Decimal.to_integer(@block.gas_used) / Decimal.to_integer(@block.gas_limit)) |> BlockScoutWeb.Cldr.Number.to_string!(format: "#.#%") %>)</span>
</dt>
</dl>
<dl class="row mb-0">
@ -147,7 +147,7 @@
<div class="text-right">
<h3 class="address-balance-text">
<%= @block.gas_used |> Cldr.Number.to_string! %>
<span class="text-muted">(<%= (Decimal.to_integer(@block.gas_used) / Decimal.to_integer(@block.gas_limit)) |> Cldr.Number.to_string!(format: "#.#%") %>)</span>
<span class="text-muted">(<%= (Decimal.to_integer(@block.gas_used) / Decimal.to_integer(@block.gas_limit)) |> BlockScoutWeb.Cldr.Number.to_string!(format: "#.#%") %>)</span>
</h3>
<p class="address-current-balance"><%= @block.gas_limit |> Cldr.Number.to_string! %><%= gettext "Gas Limit" %></p>
</div>

@ -56,7 +56,7 @@
<%= gettext "Total transactions" %>
</span>
<span class="dashboard-banner-network-stats-value" data-selector="transaction-count">
<%= Cldr.Number.to_string!(@transaction_estimated_count, format: "#,###") %>
<%= BlockScoutWeb.Cldr.Number.to_string!(@transaction_estimated_count, format: "#,###") %>
</span>
</div>
<div class="dashboard-banner-network-stats-item dashboard-banner-network-stats-item-3">
@ -64,7 +64,7 @@
<%= gettext "Total blocks" %>
</span>
<span class="dashboard-banner-network-stats-value" data-selector="block-count">
<%= Cldr.Number.to_string!(@block_count, format: "#,###") %>
<%= BlockScoutWeb.Cldr.Number.to_string!(@block_count, format: "#,###") %>
</span>
</div>
<div class="dashboard-banner-network-stats-item dashboard-banner-network-stats-item-4">
@ -72,7 +72,7 @@
<%= gettext "Wallet addresses" %>
</span>
<span class="dashboard-banner-network-stats-value" data-selector="address-count">
<%= Cldr.Number.to_string!(@address_count, format: "#,###") %>
<%= BlockScoutWeb.Cldr.Number.to_string!(@address_count, format: "#,###") %>
</span>
</div>
</div>

@ -222,7 +222,7 @@ defmodule BlockScoutWeb.AddressView do
def incoming_transaction_count(address_hash) do
address_hash
|> Chain.address_to_incoming_transaction_count()
|> Cldr.Number.to_string!(format: "#,###")
|> BlockScoutWeb.Cldr.Number.to_string!(format: "#,###")
end
def trimmed_hash(%Hash{} = hash) do

@ -33,7 +33,7 @@ defmodule BlockScoutWeb.BlockView do
# We do this to trick Dialyzer to not complain about non-local returns caused by bug in Cldr.Unit.to_string! spec
case :erlang.phash2(1, 1) do
0 ->
Cldr.Unit.to_string!(unit)
BlockScoutWeb.Cldr.Unit.to_string!(unit)
1 ->
# does not occur
@ -42,7 +42,7 @@ defmodule BlockScoutWeb.BlockView do
end
def formatted_gas(gas, format \\ []) do
Cldr.Number.to_string!(gas, format)
BlockScoutWeb.Cldr.Number.to_string!(gas, format)
end
def formatted_timestamp(%Block{timestamp: timestamp}) do

@ -100,7 +100,7 @@ defmodule BlockScoutWeb.TransactionView do
%Block{consensus: true} ->
{:ok, confirmations} = Chain.confirmations(block, named_arguments)
Cldr.Number.to_string!(confirmations, format: "#,###")
BlockScoutWeb.Cldr.Number.to_string!(confirmations, format: "#,###")
end
end

Loading…
Cancel
Save