1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.Web.TranslationHelpers do
6 defmacro render_error(conn, status, msgid, bindings \\ Macro.escape(%{})) do
8 require Pleroma.Web.Gettext
11 |> Plug.Conn.put_status(unquote(status))
12 |> Phoenix.Controller.json(%{
13 error: Pleroma.Web.Gettext.dgettext("errors", unquote(msgid), unquote(bindings))