[i18n] Make error messages translatable.

Make all strings passing through `json_error` and `JsonableError`
translatable.

Fixes #727
This commit is contained in:
Umair Khan
2016-05-25 18:02:02 +05:00
committed by Tim Abbott
parent 4b28fcd2f3
commit 08fbd57245
25 changed files with 251 additions and 198 deletions

View File

@@ -1,5 +1,6 @@
from __future__ import absolute_import
from django.utils.translation import ugettext as _
from django.views.decorators.csrf import csrf_exempt
from zerver.decorator import authenticated_json_post_view, has_request_variables, REQ
@@ -28,7 +29,7 @@ def json_tutorial_send_message(request, user_profile, type=REQ(validator=check_s
realm=user_profile.realm)
return json_success()
# For now, there are no PM cases.
return json_error('Bad data passed in to tutorial_send_message')
return json_error(_('Bad data passed in to tutorial_send_message'))
@authenticated_json_post_view
@has_request_variables