import Ecto.Changeset
import Ecto.Query
+ import Pleroma.Web.Gettext
require Pleroma.Constants
if diff > days do
:ok
else
- {:error, "Last export was less than #{days} days ago"}
+ {:error,
+ dngettext(
+ "errors",
+ "Last export was less than a day ago",
+ "Last export was less than %{days} days ago",
+ days,
+ days: days
+ )}
end
nil ->
if Pleroma.Config.get([Pleroma.Emails.Mailer, :enabled]) do
:ok
else
- {:error, "Backups require enabled email"}
+ {:error, dgettext("errors", "Backups require enabled email")}
end
end
- defp validate_user_email(%User{email: nil}), do: {:error, "Email is required"}
+ defp validate_user_email(%User{email: nil}) do
+ {:error, dgettext("errors", "Email is required")}
+ end
+
defp validate_user_email(%User{email: email}) when is_binary(email), do: :ok
def get_last(user_id) do