From 31231d9fad497518ce57a5e89650d702bdcf733b Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Mon, 11 May 2026 15:07:39 -0500 Subject: [PATCH] fix(insights): correct ngettext usage in auto-match flash MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- .../live/org/gaiia_reconciliation_live.ex | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/lib/towerops_web/live/org/gaiia_reconciliation_live.ex b/lib/towerops_web/live/org/gaiia_reconciliation_live.ex index bf79a454..c346faae 100644 --- a/lib/towerops_web/live/org/gaiia_reconciliation_live.ex +++ b/lib/towerops_web/live/org/gaiia_reconciliation_live.ex @@ -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