Commit 6ec7b34d authored by stef's avatar stef
Browse files

[enh] updated i18n markup of strings

parent 43c5d846
...@@ -45,7 +45,7 @@ def activate(request): ...@@ -45,7 +45,7 @@ def activate(request):
v=Violation.objects.get(activationid=request.GET.get('key','asdf')) v=Violation.objects.get(activationid=request.GET.get('key','asdf'))
v.activationid='' v.activationid=''
v.save() v.save()
messages.add_message(request, messages.INFO, 'Thank you for verifying your submission.') messages.add_message(request, messages.INFO, _('Thank you for verifying your submission.'))
return HttpResponseRedirect('/') # Redirect after POST return HttpResponseRedirect('/') # Redirect after POST
def add(request): def add(request):
...@@ -53,8 +53,8 @@ def add(request): ...@@ -53,8 +53,8 @@ def add(request):
form = AddViolation(request.POST) form = AddViolation(request.POST)
if form.is_valid(): if form.is_valid():
actid = hashlib.sha1(''.join([chr(randint(32, 122)) for x in range(12)])).hexdigest() actid = hashlib.sha1(''.join([chr(randint(32, 122)) for x in range(12)])).hexdigest()
msg = MIMEText("Your verification key is %s/activate?key=%s\n" % (settings.ROOT_URL or 'http://localhost:8001/',actid)) msg = MIMEText(_("Your verification key is %s/activate?key=%s\n") % (settings.ROOT_URL or 'http://localhost:8001/',actid))
msg['Subject'] = 'NNMon submission verification' msg['Subject'] = _('NNMon submission verification')
msg['From'] = 'nnmon@nnmon.lqdn.fr' msg['From'] = 'nnmon@nnmon.lqdn.fr'
msg['To'] = form.cleaned_data['email'] msg['To'] = form.cleaned_data['email']
s = smtplib.SMTP('localhost') s = smtplib.SMTP('localhost')
...@@ -92,7 +92,7 @@ def add(request): ...@@ -92,7 +92,7 @@ def add(request):
a.storage.save(sname,f) a.storage.save(sname,f)
a.save() a.save()
messages.add_message(request, messages.INFO, 'Thank you for submitting this report, you will receive a verification email shortly.') messages.add_message(request, messages.INFO, _('Thank you for submitting this report, you will receive a verification email shortly.'))
return HttpResponseRedirect('/') # Redirect after POST return HttpResponseRedirect('/') # Redirect after POST
else: else:
form = AddViolation() form = AddViolation()
......
{% load bt %}<?xml version="1.0" encoding="utf-8"?> {% load i18n %}{% load bt %}<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="hu" xml:lang="hu"> <html xmlns="http://www.w3.org/1999/xhtml" lang="hu" xml:lang="hu">
<head> <head>
...@@ -20,17 +20,17 @@ ...@@ -20,17 +20,17 @@
<div id="auth" class="menu"> <div id="auth" class="menu">
{% if user.is_authenticated %} {% if user.is_authenticated %}
<a href="{%root_url%}/accounts/settings">{{ user.username }}</a> <a href="{%root_url%}/accounts/settings">{{ user.username }}</a>
<a href="{%root_url%}/accounts/logout">Logout</a> <a href="{%root_url%}/accounts/logout">{% trans "Logout" %}</a>
<a href="{%root_url%}/admin/">Admin</a> <a href="{%root_url%}/admin/">{% trans "Admin" %}</a>
{% else %} {% else %}
<a href="{%root_url%}/accounts/login">Login</a> <a href="{%root_url%}/accounts/login">{% trans "Login" %}</a>
<a href="{%root_url%}/accounts/register">Register</a> <a href="{%root_url%}/accounts/register">{% trans "Register" %}</a>
{% endif %} {% endif %}
</div> </div>
<div id="menu" class="menu"> <div id="menu" class="menu">
<a href="{%root_url%}/add/">Report restriction</a> <a href="{%root_url%}/add/">{% trans "Report restriction" %}</a>
<a href="{%root_url%}/">List reports</a> <a href="{%root_url%}/">{% trans "List reports" %}</a>
</div> </div>
{% block content %} {% block content %}
......
...@@ -24,17 +24,17 @@ ...@@ -24,17 +24,17 @@
<table class="listing tablesorter" id='sortedlist'> <table class="listing tablesorter" id='sortedlist'>
<thead> <thead>
<tr> <tr>
<th>id</th> <th>{% trans "id" %}</th>
<th>country</th> <th>{% trans "country" %}</th>
<th>operator</th> <th>{% trans "operator" %}</th>
<th>contract</th> <th>{% trans "contract" %}</th>
<th>resource</th> <th>{% trans "resource" %}</th>
<th>type</th> <th>{% trans "type" %}</th>
<th>media</th> <th>{% trans "media" %}</th>
<th>temporary</th> <th>{% trans "temporary" %}</th>
<th>contractual</th> <th>{% trans "contractual" %}</th>
<th>contractual_excerpt</th> <th>{% trans "contractual_excerpt" %}</th>
<th>loophole</th> <th>{% trans "loophole" %}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
...@@ -63,11 +63,11 @@ ...@@ -63,11 +63,11 @@
{% endif %} {% endif %}
<span class="current"> <span class="current">
Page {{ violations.number }} of {{ violations.paginator.num_pages }}. {% trans "Page" %} {{ violations.number }} {% trans "of" %} {{ violations.paginator.num_pages }}.
</span> </span>
{% if violations.has_next %} {% if violations.has_next %}
<a href="?page={{ violations.next_page_number }}">next</a> <a href="?page={{ violations.next_page_number }}">{% trans "next" %}</a>
{% endif %} {% endif %}
</span> </span>
</div> </div>
......
...@@ -38,16 +38,16 @@ $(document).ready(function() { ...@@ -38,16 +38,16 @@ $(document).ready(function() {
{%block content%} {%block content%}
<ul id="report"> <ul id="report">
<li><dl><dt>Operator</dt><dd>{{v.operator}} ({{v.country}})</dd></dl></li> <li><dl><dt>{% trans "Operator" %}</dt><dd>{{v.operator}} ({{v.country}})</dd></dl></li>
<li><dl><dt>Contract</dt><dd>{{v.contract}}</dd></dl></li> <li><dl><dt>{% trans "Contract" %}</dt><dd>{{v.contract}}</dd></dl></li>
{%if v.resource%}<li><dl><dt>Resource</dt><dd>{{v.resource}}</dd></dl></li>{%endif%} {%if v.resource%}<li><dl><dt>{% trans "Resource" %}</dt><dd>{{v.resource}}</dd></dl></li>{%endif%}
{%if v.resource_name%}<li><dl><dt>Resource name</dt><dd>{{v.resource_name}}</dd></dl></li>{%endif%} {%if v.resource_name%}<li><dl><dt>{% trans "Resource name" %}</dt><dd>{{v.resource_name}}</dd></dl></li>{%endif%}
{%if v.type%}<li><dl><dt>Type</dt><dd>{{v.type}}</dd></dl></li>{%endif%} {%if v.type%}<li><dl><dt>{% trans "Type" %}</dt><dd>{{v.type}}</dd></dl></li>{%endif%}
{%if v.media%}<li><dl><dt>Media</dt><dd>{{v.media}}</dd></dl></li>{%endif%} {%if v.media%}<li><dl><dt>{% trans "Media" %}</dt><dd>{{v.media}}</dd></dl></li>{%endif%}
{%if v.temporary%}<li><dl><dt>Temporary restriction</dt><dd>{{v.temporary}}</dd></dl></li>{%endif%} {%if v.temporary%}<li><dl><dt>{% trans "Temporary restriction" %}r</dt><dd>{{v.temporary}}</dd></dl></li>{%endif%}
{%if v.loophole%}<li><dl><dt>Loophole offering</dt><dd>{{v.loophole}}</dd></dl></li>{%endif%} {%if v.loophole%}<li><dl><dt>{% trans "Loophole offering" %}</dt><dd>{{v.loophole}}</dd></dl></li>{%endif%}
{%if v.contractual%}<li><dl><dt>Contractual restriction</dt><dd>{{v.Contractual}}</dd></dl></li>{%endif%} {%if v.contractual%}<li><dl><dt>{% trans "Contractual restriction" %}</dt><dd>{{v.Contractual}}</dd></dl></li>{%endif%}
{%if v.contract_excerpt%}<li><dl><dt>Contract excerpt</dt><dd>{{v.contract_excerpt|safe}}</dd></dl></li>{%endif%} {%if v.contract_excerpt%}<li><dl><dt>{% trans "Contract excerpt" %}</dt><dd>{{v.contract_excerpt|safe}}</dd></dl></li>{%endif%}
{%if v.comment_set.all%} {%if v.comment_set.all%}
<li id="description"> <li id="description">
<h3>{%trans "Description" %}</h3> <h3>{%trans "Description" %}</h3>
...@@ -57,7 +57,7 @@ $(document).ready(function() { ...@@ -57,7 +57,7 @@ $(document).ready(function() {
<div class="description">{{c.comment|safe}}</div> <div class="description">{{c.comment|safe}}</div>
{%if c.attachment_set.all%} {%if c.attachment_set.all%}
<div class="attachs"> <div class="attachs">
Attachments {% trans "Attachments" %}
<ul> <ul>
{%for a in c.attachment_set.all%} {%for a in c.attachment_set.all%}
<li><a href="{{a.storage.url}}">{{a.storage.name}}</a></li> <li><a href="{{a.storage.url}}">{{a.storage.name}}</a></li>
...@@ -70,9 +70,9 @@ $(document).ready(function() { ...@@ -70,9 +70,9 @@ $(document).ready(function() {
</li> </li>
</ul> </ul>
{%endif%} {%endif%}
<h3>Comments</h3> <h3>{% trans "Comments" %}</h3>
{% render_comment_list for v %} {% render_comment_list for v %}
<h3>Comment</h3> <h3>{% trans "Comment" %}</h3>
{% get_comment_form for v as form %} {% get_comment_form for v as form %}
<div id="comment_form"> <div id="comment_form">
{% render_comment_form for v %} {% render_comment_form for v %}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment