fix gettext for percentages

This commit is contained in:
shibao 2022-11-08 21:34:36 -05:00
parent ffd1029e78
commit 13bf8ab2b1
8 changed files with 38 additions and 2 deletions

View File

@ -194,7 +194,7 @@ defmodule CanneryWeb.AmmoGroupLive.Index do
end
defp get_value_for_key(:remaining, ammo_group),
do: "#{ammo_group |> Ammo.get_percentage_remaining()}%"
do: gettext("%{percentage}%", percentage: ammo_group |> Ammo.get_percentage_remaining())
defp get_value_for_key(:actions, ammo_group) do
assigns = %{ammo_group: ammo_group}

View File

@ -16,7 +16,7 @@
<span class="rounded-lg title text-lg">
<%= gettext("Percentage left:") %>
<%= "#{@ammo_group |> Ammo.get_percentage_remaining()}%" %>
<%= gettext("%{percentage}%", percentage: @ammo_group |> Ammo.get_percentage_remaining()) %>
</span>
<%= if @ammo_group.notes do %>

View File

@ -962,3 +962,9 @@ msgstr ""
#, elixir-autogen, elixir-format
msgid "Used up on:"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.ex:197
#: lib/cannery_web/live/ammo_group_live/show.html.heex:19
#, elixir-autogen, elixir-format
msgid "%{percentage}%"
msgstr ""

View File

@ -945,3 +945,9 @@ msgstr ""
#, elixir-autogen, elixir-format
msgid "Used up on:"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.ex:197
#: lib/cannery_web/live/ammo_group_live/show.html.heex:19
#, elixir-autogen, elixir-format
msgid "%{percentage}%"
msgstr ""

View File

@ -946,3 +946,9 @@ msgstr ""
#, elixir-autogen, elixir-format
msgid "Used up on:"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.ex:197
#: lib/cannery_web/live/ammo_group_live/show.html.heex:19
#, elixir-autogen, elixir-format
msgid "%{percentage}%"
msgstr ""

View File

@ -960,3 +960,9 @@ msgstr ""
#, elixir-autogen, elixir-format
msgid "Used up on:"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.ex:197
#: lib/cannery_web/live/ammo_group_live/show.html.heex:19
#, elixir-autogen, elixir-format
msgid "%{percentage}%"
msgstr ""

View File

@ -965,3 +965,9 @@ msgstr ""
#, elixir-autogen, elixir-format
msgid "Used up on:"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.ex:197
#: lib/cannery_web/live/ammo_group_live/show.html.heex:19
#, elixir-autogen, elixir-format
msgid "%{percentage}%"
msgstr ""

View File

@ -956,3 +956,9 @@ msgstr ""
#, elixir-autogen, elixir-format
msgid "Used up on:"
msgstr ""
#: lib/cannery_web/live/ammo_group_live/index.ex:197
#: lib/cannery_web/live/ammo_group_live/show.html.heex:19
#, elixir-autogen, elixir-format
msgid "%{percentage}%"
msgstr ""