{% load i18n rest_framework %}
{% if request.method == 'POST' %}
{% if not serializer.is_valid %}
{% trans 'There have been errors in the data you submitted.' %}
{% else %}
{% blocktrans with username=user.username %}Welcome {{ username }}. Your account has been created successfully and you have been logged in.{% endblocktrans %}