Skip to content

Commit

Permalink
fix: properly stringify lists of atoms in gettext
Browse files Browse the repository at this point in the history
  • Loading branch information
zachdaniel committed Feb 17, 2025
1 parent 03d654e commit a1fdf9a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/ash_authentication_phoenix_web.ex
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,15 @@ defmodule AshAuthentication.Phoenix.Web do

def gettext_switch(nil, msgid, bindings) do
for {key, value} <- bindings, reduce: msgid do
acc -> String.replace(acc, "%{#{key}}", to_string(value))
acc ->
value =
if is_list(value) do
Enum.map_join(value, ", ", &to_string/1)
else
value
end

String.replace(acc, "%{#{key}}", to_string(value))
end
end

Expand Down

0 comments on commit a1fdf9a

Please sign in to comment.