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
10 bindings \\ Macro.escape(%{}),
11 identifier \\ Macro.escape("")
14 require Pleroma.Web.Gettext
18 error: Pleroma.Web.Gettext.dgettext("errors", unquote(msgid), unquote(bindings)),
19 identifier: unquote(identifier)
21 |> Enum.reject(fn {_k, v} -> v == "" end)
25 |> Plug.Conn.put_status(unquote(status))
26 |> Phoenix.Controller.json(error_map)