Skip to content

Commit

Permalink
Add i18n/l10n support
Browse files Browse the repository at this point in the history
  • Loading branch information
Drew Hubl committed Jun 17, 2015
1 parent e2527d8 commit ad80001
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
10 changes: 5 additions & 5 deletions watchman/templates/watchman/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% load i18n %}

{% block content %}
<h2>System Status{% if overall_status == 'OK' %} <small>All systems up and running!</small>{% endif %}</h2>
<h2>{% trans 'System Status' %}{% if overall_status == 'OK' %} <small>{% trans 'All systems up and running!' %}</small>{% endif %}</h2>

<table class="table table-bordered table-hover">
<thead>
Expand All @@ -21,11 +21,11 @@ <h2>System Status{% if overall_status == 'OK' %} <small>All systems up and runni
<td>{{ thing.name|title }}</td>

{% if thing.status == 'OK' %}
<td class="success">{{ thing.status }}</td>
<td class="success">{% trans 'OK' %}</td>

{% else %}
<td class="danger">
<button type="button" class="btn btn-danger" data-toggle="modal" data-target="#{{ type.type }}-{{ thing.name }}">ERROR!</button>
<button type="button" class="btn btn-danger" data-toggle="modal" data-target="#{{ type.type }}-{{ thing.name }}">{% trans 'ERROR!' %}</button>

<div class="modal fade" id="{{ type.type }}-{{ thing.name }}" tabindex="-1" role="dialog" aria-labelledby="{{ type.type }}-{{ thing.name }}-title">
<div class="modal-dialog" role="document">
Expand All @@ -51,11 +51,11 @@ <h4><pre>{{ thing.error }}</pre></h4>
{% endfor %}{# for thing in type.statuses #}
{% empty %}
<tr>
<td colspan="3">No checks indicated</td>
<td colspan="3">{% trans 'No checks indicated.' %}</td>
</tr>
{% endfor %}{# for type in checks #}
</tbody>
</table>

<span class="pull-right"><small>Click an error button to see the full traceback</small></span>
<span class="pull-right"><small>{% trans 'Click an error button to see the full traceback' %}</small></span>
{% endblock %}{# status_content #}
3 changes: 2 additions & 1 deletion watchman/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down

0 comments on commit ad80001

Please sign in to comment.