From ad800013f06f81e14df710679904f56a2cd69922 Mon Sep 17 00:00:00 2001 From: Drew Hubl Date: Wed, 17 Jun 2015 05:25:49 -0600 Subject: [PATCH] Add i18n/l10n support --- watchman/templates/watchman/dashboard.html | 10 +++++----- watchman/views.py | 3 ++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/watchman/templates/watchman/dashboard.html b/watchman/templates/watchman/dashboard.html index e6a81a2..35d28ae 100644 --- a/watchman/templates/watchman/dashboard.html +++ b/watchman/templates/watchman/dashboard.html @@ -3,7 +3,7 @@ {% load i18n %} {% block content %} -

System Status{% if overall_status == 'OK' %} All systems up and running!{% endif %}

+

{% trans 'System Status' %}{% if overall_status == 'OK' %} {% trans 'All systems up and running!' %}{% endif %}

@@ -21,11 +21,11 @@

System Status{% if overall_status == 'OK' %} All systems up and runni

{% if thing.status == 'OK' %} - + {% else %} - + {% endfor %}{# for type in checks #}
{{ thing.name|title }}{{ thing.status }}{% trans 'OK' %} - +
No checks indicated{% trans 'No checks indicated.' %}
-Click an error button to see the full traceback +{% trans 'Click an error button to see the full traceback' %} {% endblock %}{# status_content #} diff --git a/watchman/views.py b/watchman/views.py index d1a5b82..0e3f394 100644 --- a/watchman/views.py +++ b/watchman/views.py @@ -4,6 +4,7 @@ from django.http import Http404 from django.shortcuts import render +from django.utils.translation import ugettext as _ from jsonview.decorators import json_view from watchman.decorators import token_required @@ -29,7 +30,7 @@ def status(request): response.update(check()) if len(response) == 0: - raise Http404('No checks found') + raise Http404(_('No checks found')) return response