From 8506b0e923f6191cdaa6c02bedbab76d4cfd956d Mon Sep 17 00:00:00 2001 From: nikitosing Date: Mon, 25 Oct 2021 19:38:59 +0300 Subject: [PATCH] Show nil block.size as N/A bytes --- CHANGELOG.md | 1 + .../lib/block_scout_web/templates/block/overview.html.eex | 2 +- apps/block_scout_web/priv/gettext/default.pot | 5 +++++ .../block_scout_web/priv/gettext/en/LC_MESSAGES/default.po | 7 ++++++- 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e30c975de5..3afb376425 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ - [#4579](https://github.com/blockscout/blockscout/pull/4579) - Write contract page: Resize inputs; Improve multiplier selector ### Fixes +- [#4810](https://github.com/blockscout/blockscout/pull/4810) - Show `nil` block.size as `N/A bytes` - [#4798](https://github.com/blockscout/blockscout/pull/4798) - Token instance View contract icon Safari fix - [#4796](https://github.com/blockscout/blockscout/pull/4796) - Fix nil.timestamp issue - [#4764](https://github.com/blockscout/blockscout/pull/4764) - Add cleaning of substrings of `require` messages from parsed constructor arguments diff --git a/apps/block_scout_web/lib/block_scout_web/templates/block/overview.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/block/overview.html.eex index 03849dd586..7943d5ea5d 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/block/overview.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/block/overview.html.eex @@ -107,7 +107,7 @@ text: gettext("Size of the block in bytes.") %> <%= gettext("Size") %> -
<%= Cldr.Unit.new(:byte, @block.size) |> cldr_unit_to_string!() %>
+
<%= if !is_nil(@block.size), do: (Cldr.Unit.new(:byte, @block.size) |> cldr_unit_to_string!()), else: gettext("N/A bytes") %>
diff --git a/apps/block_scout_web/priv/gettext/default.pot b/apps/block_scout_web/priv/gettext/default.pot index b52e89db91..e388c07a48 100644 --- a/apps/block_scout_web/priv/gettext/default.pot +++ b/apps/block_scout_web/priv/gettext/default.pot @@ -3216,3 +3216,8 @@ msgstr "" #: lib/block_scout_web/templates/address_token/overview.html.eex:66 msgid "Shows the total CRC balance in the address." msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/block/overview.html.eex:110 +msgid "N/A bytes" +msgstr "" diff --git a/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po b/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po index aa62599504..e388c07a48 100644 --- a/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po +++ b/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po @@ -3212,7 +3212,12 @@ msgstr "" msgid "CRC Worth" msgstr "" -#, elixir-format, fuzzy +#, elixir-format #: lib/block_scout_web/templates/address_token/overview.html.eex:66 msgid "Shows the total CRC balance in the address." msgstr "" + +#, elixir-format +#: lib/block_scout_web/templates/block/overview.html.eex:110 +msgid "N/A bytes" +msgstr ""