elixir - How can I generate gettext translations for ecto model field names? -


i have usual ecto.model , need register fields translations move them .pot file. how can that?

update

i'm using these field names prepare list of translated errors:

errors = changeset   |> ecto.changeset.traverse_errors(fn {msg, opts} ->     enum.reduce(opts, msg, fn {key, value}, _ ->       string.replace(msg, "%{#{key}}", to_string(value))     end)   end)  formatted = {field, messages} <- errors,                 message <- messages,                 do: "#{field} #{translate_error(message)}" # functionality here    defp translate_error(msgid)     gettext.dgettext(myapp.gettext, "errors", msgid)   end 

i want translate not message, field too!


Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -