diff --git a/lib/doggo.ex b/lib/doggo.ex index d7dcc713..83d88c81 100644 --- a/lib/doggo.ex +++ b/lib/doggo.ex @@ -1468,6 +1468,12 @@ defmodule Doggo do defp field_description_id(id) when is_binary(id), do: "#{id}_description" + defp translate_error({msg, opts}, nil) do + Enum.reduce(opts, msg, fn {key, value}, acc -> + String.replace(acc, "%{#{key}}", fn _ -> to_string(value) end) + end) + end + defp translate_error({msg, opts}, gettext_module) when is_atom(gettext_module) do if count = opts[:count] do @@ -1477,12 +1483,6 @@ defmodule Doggo do end end - defp translate_error({msg, opts}, nil) do - Enum.reduce(opts, msg, fn {key, value}, acc -> - String.replace(acc, "%{#{key}}", fn _ -> to_string(value) end) - end) - end - @doc """ Renders a modal.