fix(insights): correct ngettext usage in auto-match flash
ngettext is a macro that already calls dngettext internally. The previous code was calling dngettext a second time on the result string, passing nil as the count — causing a FunctionClauseError.
This commit is contained in:
parent
3267bb134f
commit
31231d9fad
1 changed files with 7 additions and 11 deletions
|
|
@ -68,18 +68,14 @@ defmodule ToweropsWeb.Org.GaiiaReconciliationLive do
|
|||
defp match_flash({:ok, ip_matched, site_matched, remaining}) do
|
||||
total = ip_matched + site_matched
|
||||
|
||||
"Auto-matched %{total} device (%{ip} by IP, %{site} by site). %{remaining} remaining."
|
||||
|> ngettext(
|
||||
ngettext(
|
||||
"Auto-matched %{total} device (%{ip} by IP, %{site} by site). %{remaining} remaining.",
|
||||
"Auto-matched %{total} devices (%{ip} by IP, %{site} by site). %{remaining} remaining.",
|
||||
total
|
||||
)
|
||||
|> then(
|
||||
&Gettext.dngettext(ToweropsWeb.Gettext, "", &1, &1,
|
||||
total: total,
|
||||
ip: ip_matched,
|
||||
site: site_matched,
|
||||
remaining: remaining
|
||||
)
|
||||
total,
|
||||
total: total,
|
||||
ip: ip_matched,
|
||||
site: site_matched,
|
||||
remaining: remaining
|
||||
)
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue