Mercurial > p > roundup > code
changeset 6054:ffaf89a4a9d9
use jinja2 i18n extension
enable autoescape for jinja2 templates
line wrap: on
line diff
--- a/roundup/cgi/engine_jinja2.py Mon Jan 13 09:36:40 2020 +0100 +++ b/roundup/cgi/engine_jinja2.py Mon Jan 13 21:18:42 2020 +0000 @@ -47,7 +47,8 @@ def __init__(self, dir): self._env = jinja2.Environment( loader=jinja2.FileSystemLoader(dir), - extensions=[] + extensions=['jinja2.ext.i18n'], + autoescape=True ) # Adding a custom filter that can transform roundup's vars to unicode @@ -87,7 +88,10 @@ def render(self, client, classname, request, **options): # [ ] limit the information passed to the minimal necessary set c = context(client, self, classname, request) - c.update({'options': options}) + + c.update({'options': options, + 'gettext': lambda s: s2u(client.gettext(s)), + 'ngettext': lambda s, p, n: s2u(client.ngettext(s, p, n))}) s = self._tpl.render(c) return s if sys.version_info[0] > 2 else \ s.encode(client.STORAGE_CHARSET, )
--- a/share/roundup/templates/jinja2/html/_generic.404.html Mon Jan 13 09:36:40 2020 +0100 +++ b/share/roundup/templates/jinja2/html/_generic.404.html Mon Jan 13 21:18:42 2020 +0000 @@ -1,12 +1,12 @@ {% extends 'layout/page.html' %} {% block head_title %} - 404 - {{ i18n.gettext('page not found')|u }} + 404 - {% trans %}page not found{% endtrans %} {% endblock %} {% block page_content %} <div class='container-fluid'> - <h1 class='text-error'>{{ i18n.gettext('404 - page not found')|u }}</h1> - <p style='text-align: center'>{{ i18n.gettext('What were you looking for anyways?')|u }}</p> + <h1 class='text-error'>{% trans %}404 - page not found{% endtrans %}</h1> + <p style='text-align: center'>{% trans %}What were you looking for anyways?{% endtrans %}</p> </div> {% endblock %}
--- a/share/roundup/templates/jinja2/html/_generic.collision.html Mon Jan 13 09:36:40 2020 +0100 +++ b/share/roundup/templates/jinja2/html/_generic.collision.html Mon Jan 13 21:18:42 2020 +0000 @@ -1,19 +1,19 @@ {% extends 'layout/page.html' %} {% block head_title %} - {{ i18n.gettext('Edit Collision')|u }} - {{ config.TRACKER_NAME }} + {% trans %}Edit Collision{% endtrans %} - {{ config.TRACKER_NAME }} {% endblock %} {% block page_header %} - {{ i18n.gettext('Edit Collision')|u }} - {{ config.TRACKER_NAME }} + {% trans %}Edit Collision{% endtrans %} - {{ config.TRACKER_NAME }} {% endblock %} {% block content %} <p> - {{ i18n.gettext('There has been a collision. + {% trans %}There has been a collision. Another user updated this node - while you were editing. Please') }} - <a href='{{ context }}'>{{ i18n.gettext('reload')|u }}</a> - {{ i18n.gettext('the node and review your edits.')|u }} + while you were editing. Please{% endtrans %} + <a href='{{ context }}'>{% trans %}reload{% endtrans %}</a> + {% trans %}the node and review your edits.{% endtrans %} </p> {% endblock %}
--- a/share/roundup/templates/jinja2/html/_generic.help-empty.html Mon Jan 13 09:36:40 2020 +0100 +++ b/share/roundup/templates/jinja2/html/_generic.help-empty.html Mon Jan 13 21:18:42 2020 +0000 @@ -1,11 +1,11 @@ {% extends 'layout/page.html' %} {% block head_title %} - {{ i18n.gettext('Empty page')|u }} + {% trans %}Empty page{% endtrans %} {% endblock %} {% block page_content %} <p> - {{ i18n.gettext('Please specify your search parameters!')|u }} + {% trans %}Please specify your search parameters!{% endtrans %} </p> {% endblock %}
--- a/share/roundup/templates/jinja2/html/_generic.index.html Mon Jan 13 09:36:40 2020 +0100 +++ b/share/roundup/templates/jinja2/html/_generic.index.html Mon Jan 13 21:18:42 2020 +0000 @@ -1,11 +1,11 @@ {% extends 'layout/page.html' %} {% block head_title %} - {{ context._classname.capitalize() }} {{ i18n.gettext('editing')|u }} + {{ context._classname.capitalize() }} {% trans %}editing{% endtrans %} {% endblock %} {% block page_header %} - {{ context._classname.capitalize() }} {{ i18n.gettext('editing')|u }} + {{ context._classname.capitalize() }} {% trans %}editing{% endtrans %} {% endblock %} {% block content %} @@ -13,30 +13,30 @@ {% include 'layout/permission.html' %} {% if context.is_view_ok() %} - <p class="form-help">{{ i18n.gettext(' + <p class="form-help">{% trans %} You may edit the contents of the class using this form. Commas, newlines and double quotes (") must be handled delicately. You may include commas and newlines by enclosing the values in double-quotes ("). Double quotes themselves must be quoted by doubling (""). - ') }}</p> + {% endtrans %}</p> - <p class="form-help">{{ i18n.gettext(' + <p class="form-help">{% trans %} Multilink properties have their multiple values colon (":") separated (... ,"one:two:three", ...) - ') }}</p> + {% endtrans %}</p> - <p class="form-help">{{ i18n.gettext(' + <p class="form-help">{% trans %} Remove entries by deleting their line. Add new entries by appending them to the table - put an X in the id column. If you wish to restore a removed item and you know its id then just put that id in the id column. - ') }}</p> + {% endtrans %}</p> <form method="POST" action='{{ context.designator() }}'> - <textarea rows="15" style="width:90%" name="rows">{{ context.csv()|u|e }}</textarea> + <textarea rows="15" style="width:90%" name="rows">{{ context.csv()|u }}</textarea> <br> <input name="@csrf" type="hidden" value="{{ utils.anti_csrf_nonce() }}"> <input type="hidden" name="@action" value="editCSV"> - <input type="submit" value="{{ i18n.gettext('Edit Items')|u }}"> + <input type="submit" value="{% trans %}Edit Items{% endtrans %}"> </form> {% endif %}
--- a/share/roundup/templates/jinja2/html/file.index.html Mon Jan 13 09:36:40 2020 +0100 +++ b/share/roundup/templates/jinja2/html/file.index.html Mon Jan 13 21:18:42 2020 +0000 @@ -1,22 +1,22 @@ -<h4>{{ i18n.gettext('Files')|u }}</h4> +<h4>{% trans %}Files{% endtrans %}</h4> <table class='table'> <tr> - <th>{{ i18n.gettext('File name')|u }}</th> - <th>{{ i18n.gettext('Uploaded')|u }}</th> - <th>{{ i18n.gettext('Type')|u }}</th> - <th>{{ i18n.gettext('Edit')|u }}</th> - <th>{{ i18n.gettext('Remove')|u }}</th> + <th>{% trans %}File name{% endtrans %}</th> + <th>{% trans %}Uploaded{% endtrans %}</th> + <th>{% trans %}Type{% endtrans %}</th> + <th>{% trans %}Edit{% endtrans %}</th> + <th>{% trans %}Remove{% endtrans %}</th> </tr> {% for file in context.files %} <tr> <td> - <a href='{{ file.download_url() }}'>{{ file.name.plain()|u|e }}</a> + <a href='{{ file.download_url() }}'>{{ file.name.plain()|u }}</a> </td> - <td>{{ file.creator.plain()|u|e }}, {{ file.creation.plain()|u|e }}</td> - <td>{{ file.type.plain()|u|e }}</td> + <td>{{ file.creator.plain()|u }}, {{ file.creation.plain()|u }}</td> + <td>{{ file.type.plain()|u }}</td> {% if file.is_edit_ok %} <td> - <a href='file{{ file.id }}'>{{ i18n.gettext('edit')|u }}</a> + <a href='file{{ file.id }}'>{% trans %}edit{% endtrans %}</a> </td> {% endif %} {% if context.is_edit_ok %} @@ -25,7 +25,7 @@ <input type="hidden" name="@remove@files" value='{{ file.id }}'> <input name="@csrf" type="hidden" value="{{ utils.anti_csrf_nonce() }}"> <input type="hidden" name="@action" value="edit"> - <input type="submit" value="{{ i18n.gettext('remove')|u }}"> + <input type="submit" value="{% trans %}remove{% endtrans %}"> </form> </td> {% endif %}
--- a/share/roundup/templates/jinja2/html/file.item.html Mon Jan 13 09:36:40 2020 +0100 +++ b/share/roundup/templates/jinja2/html/file.item.html Mon Jan 13 21:18:42 2020 +0000 @@ -1,11 +1,11 @@ {% extends 'layout/page.html' %} {% block head_title %} - {{ i18n.gettext('File display')|u }} + {% trans %}File display{% endtrans %} {% endblock %} {% block page_header %} - {{ i18n.gettext('File display')|u }} + {% trans %}File display{% endtrans %} {% endblock %} {% block content %} @@ -17,31 +17,31 @@ enctype="multipart/form-data" action='{{ context.designator() }}'> <dl class='dl-horizontal'> - <dt>{{ i18n.gettext('Name')|u }}</dt> - <dd>{{ context.name.field()|u }}</dd> - <dt>{{ i18n.gettext('Content Type')|u }}</dt> - <dd>{{ context.type.field()|u }}</dd> + <dt>{% trans %}Name{% endtrans %}</dt> + <dd>{{ context.name.field()|u|safe }}</dd> + <dt>{% trans %}Content Type{% endtrans %}</dt> + <dd>{{ context.type.field()|u|safe }}</dd> </dl> <input type="hidden" name="@template" value="item"> <input type="hidden" name="@required" value="name,type"> {% if '@multilink' in request.form %} <input type="hidden" name="@multilink" - value='{{ request.form["@multilink"].value()|u|e }}'> + value='{{ request.form["@multilink"].value()|u }}'> {% endif %} <div class='form-actions'> - {{ context.submit()|u }} + {{ context.submit()|u|safe }} </div> </form> {% endif %} {% if context.id and context.is_view_ok() %} <div class='row-fluid'> - <a href='file{{ context.id }}/{{ context.name.plain()|u|e }}'>{{ i18n.gettext('Download')|u }}</a> + <a href='file{{ context.id }}/{{ context.name.plain()|u }}'>{% trans %}Download{% endtrans %}</a> </div> {% endif %} <div class='vspace-five'></div> - {{ context.history()|u }} + {{ context.history()|u|safe }} {% endblock %}
--- a/share/roundup/templates/jinja2/html/home.classlist.html Mon Jan 13 09:36:40 2020 +0100 +++ b/share/roundup/templates/jinja2/html/home.classlist.html Mon Jan 13 21:18:42 2020 +0000 @@ -1,11 +1,11 @@ {% extends 'layout/page.html' %} {% block head_title %} - {{ i18n.gettext('List of classes')|u }} + {% trans %}List of classes{% endtrans %} {% endblock %} {% block page_header %} - {{ i18n.gettext('List of classes')|u }} + {% trans %}List of classes{% endtrans %} {% endblock %} {% block content %}
--- a/share/roundup/templates/jinja2/html/home.html Mon Jan 13 09:36:40 2020 +0100 +++ b/share/roundup/templates/jinja2/html/home.html Mon Jan 13 21:18:42 2020 +0000 @@ -4,5 +4,5 @@ filter=['status'], columns=['id','activity','title','creator','assignedto', 'status'], filterspec={'status':['-1','1','2','3','4','5','6','7']} - )|u + )|u|safe }}
--- a/share/roundup/templates/jinja2/html/issue.index.html Mon Jan 13 09:36:40 2020 +0100 +++ b/share/roundup/templates/jinja2/html/issue.index.html Mon Jan 13 21:18:42 2020 +0000 @@ -1,11 +1,11 @@ {% extends 'layout/page.html' %} {% block head_title %} - {{ i18n.gettext('List of issues')|u }} + {% trans %}List of issues{% endtrans %} {% endblock %} {% block page_header %} - {{ i18n.gettext('List of issues')|u }} + {% trans %}List of issues{% endtrans %} {% endblock %} {% block content %} @@ -17,63 +17,63 @@ <table class='table'> <tr class='info'> {% if request.show.priority %} - <td>{{ i18n.gettext('Priority')|u }}</td> + <td>{% trans %}Priority{% endtrans %}</td> {% endif %} {% if request.show.id %} - <td>{{ i18n.gettext('ID')|u }}</td> + <td>{% trans %}ID{% endtrans %}</td> {% endif %} {% if request.show.activity %} - <td>{{ i18n.gettext('Activity')|u }}</td> + <td>{% trans %}Activity{% endtrans %}</td> {% endif %} {% if request.show.actor %} - <td>{{ i18n.gettext('Actor')|u }}</td> + <td>{% trans %}Actor{% endtrans %}</td> {% endif %} {% if request.show.keyword %} - <td>{{ i18n.gettext('Keyword')|u }}</td> + <td>{% trans %}Keyword{% endtrans %}</td> {% endif %} {% if request.show.title %} - <td>{{ i18n.gettext('Title')|u }}</td> + <td>{% trans %}Title{% endtrans %}</td> {% endif %} {% if request.show.status %} - <td>{{ i18n.gettext('Status')|u }}</td> + <td>{% trans %}Status{% endtrans %}</td> {% endif %} {% if request.show.creator %} - <td>{{ i18n.gettext('Creator')|u }}</td> + <td>{% trans %}Creator{% endtrans %}</td> {% endif %} {% if request.show.assignedto %} - <td>{{ i18n.gettext('Assigned To')|u }}</td> + <td>{% trans %}Assigned To{% endtrans %}</td> {% endif %} </tr> {% for issue in request.batch() %} <tr> {% if request.show.priority %} - <td>{{ issue.priority.plain()|u|e }}</td> + <td>{{ issue.priority.plain()|u }}</td> {% endif %} {% if request.show.id %} <td>{{ issue.id }}</td> {% endif %} {% if request.show.activity %} - <td>{{ issue.activity.reldate()|u|e }}</td> + <td>{{ issue.activity.reldate()|u }}</td> {% endif %} {% if request.show.actor %} - <td>{{ issue.actor.plain()|u|e }}</td> + <td>{{ issue.actor.plain()|u }}</td> {% endif %} {% if request.show.keyword %} - <td>{{ issue.keyword.plain()|u|e }}</td> + <td>{{ issue.keyword.plain()|u }}</td> {% endif %} {% if request.show.title %} <td> - <a href='issue{{ issue.id }}'>{{ issue.title.plain(hyperlink=0)|u|e }}</a> + <a href='issue{{ issue.id }}'>{{ issue.title.plain(hyperlink=0)|u }}</a> </td> {% endif %} {% if request.show.status %} - <td>{{ issue.status.plain()|u|e }}</td> + <td>{{ issue.status.plain()|u }}</td> {% endif %} {% if request.show.creator %} - <td>{{ issue.creator.plain()|u|e }}</td> + <td>{{ issue.creator.plain()|u }}</td> {% endif %} {% if request.show.assignedto %} - <td>{{ issue.assignedto.plain()|u|e }}</td> + <td>{{ issue.assignedto.plain()|u }}</td> {% endif %} </tr> {% endfor %} @@ -83,7 +83,7 @@ <div class='pull-right'> <a class='btn btn-success' href="{{ request.indexargs_url('issue', {'@action':'export_csv'}) }}"> - {{ i18n.gettext('Download as CSV')|u }} + {% trans %}Download as CSV{% endtrans %} </a> </div> </div> @@ -91,7 +91,7 @@ {% include 'layout/sort.html' %} {% else %} - <p class='text-error'>{{ i18n.gettext('There are no issues yet!')|u }}</p> + <p class='text-error'>{% trans %}There are no issues yet!{% endtrans %}</p> {% endif %} {% endif %}
--- a/share/roundup/templates/jinja2/html/issue.item.edit.html Mon Jan 13 09:36:40 2020 +0100 +++ b/share/roundup/templates/jinja2/html/issue.item.edit.html Mon Jan 13 21:18:42 2020 +0000 @@ -11,51 +11,51 @@ <fieldset> <!-- title --> <div class='form-group row'> - <label class='col-3 col-form-label' for='title'>{{ i18n.gettext('Title')|u }}</label> + <label class='col-3 col-form-label' for='title'>{% trans %}Title{% endtrans %}</label> <div class='col-9'> - <input class="form-control" name='title' id='title' type='text' class='input-lg' value='{{ context.title.plain()|u|e }}' required> + <input class="form-control" name='title' id='title' type='text' class='input-lg' value='{{ context.title.plain()|u }}' required> </div> </div> <!-- form-group row --> <!-- priority & Status --> <div class='form-group row'> - <label class='col-3 col-form-label' for='priority'>{{ i18n.gettext('Priority')|u }}</label> + <label class='col-3 col-form-label' for='priority'>{% trans %}Priority{% endtrans %}</label> <div class='col-3'> - {{ context.priority.menu(html_kwargs={"class": "custom-select"})|u }} + {{ context.priority.menu(html_kwargs={"class": "custom-select"})|u|safe }} </div> - <label class='col-3 col-form-label' for='status'>{{ i18n.gettext('Status')|u }}</label> + <label class='col-3 col-form-label' for='status'>{% trans %}Status{% endtrans %}</label> <div class='col-3'> - {{ context.status.menu(html_kwargs={"class": "custom-select"})|u }} + {{ context.status.menu(html_kwargs={"class": "custom-select"})|u|safe }} </div> </div> <!-- form-group row --> <!-- Superseder & nosy list --> <div class='form-group row'> - <label class='col-3 col-form-label' for='superseder'>{{ i18n.gettext('Superseder')|u }}</label> + <label class='col-3 col-form-label' for='superseder'>{% trans %}Superseder{% endtrans %}</label> <div class='col-3'> - <input class="form-control" type='text' name='superseder' id='superseder' value='{{ context.superseder.plain()|u|e }}'> + <input class="form-control" type='text' name='superseder' id='superseder' value='{{ context.superseder.plain()|u }}'> </div> - <label class='col-3 col-form-label' for='nosylist'>{{ i18n.gettext('Nosy list')|u }}</label> + <label class='col-3 col-form-label' for='nosylist'>{% trans %}Nosy list{% endtrans %}</label> <div class='col-3'> - <input class="form-control" type='text' name='nosy' id='nosylist' value='{{ context.nosy.plain()|u|e }}'> + <input class="form-control" type='text' name='nosy' id='nosylist' value='{{ context.nosy.plain()|u }}'> </div> </div> <!-- form-group row --> <!-- Assigned to & keywords --> <div class='form-group row'> - <label class='col-3 col-form-label' for='assignedto'>{{ i18n.gettext('Assigned to')|u }}</label> + <label class='col-3 col-form-label' for='assignedto'>{% trans %}Assigned to{% endtrans %}</label> <div class='col-3'> - {{ context.assignedto.menu(html_kwargs={"class": "custom-select"})|u }} + {{ context.assignedto.menu(html_kwargs={"class": "custom-select"})|u|safe }} </div> - <label class='col-3 col-form-label' for='keyword'>{{ i18n.gettext('Keywords')|u }}</label> + <label class='col-3 col-form-label' for='keyword'>{% trans %}Keywords{% endtrans %}</label> <div class='col-3'> - <input class="form-control" type='text' name='keyword' id='keyword' value='{{ context.keyword.plain()|u|e }}'> + <input class="form-control" type='text' name='keyword' id='keyword' value='{{ context.keyword.plain()|u }}'> </div> </div> <!-- form-group row --> <!-- Note --> <div class='form-group row'> - <label class='col-3 col-form-label' for='change_note'>{{ i18n.gettext('Change note')|u }}</label> + <label class='col-3 col-form-label' for='change_note'>{% trans %}Change note{% endtrans %}</label> <div class='col-9'> <textarea class="form-control" name="@note" rows="5" class='input-lg' id='change_note'></textarea> </div> @@ -63,16 +63,16 @@ <!-- File upload --> <div class='form-group row'> - <label class='col-3 col-form-label' for='file_upload'>{{ i18n.gettext('File')|u }}</label> + <label class='col-3 col-form-label' for='file_upload'>{% trans %}File{% endtrans %}</label> <div class='col-3'> <input class="form-control-file" type="file" name="@file" id='file_upload'> </div> </div> <!-- form-group row --> </fieldset> <div class='form-actions'> - {{ context.submit(html_kwargs={"class": "btn btn-primary"}) }} + {{ context.submit(html_kwargs={"class": "btn btn-primary"})|u|safe }} {% if context.id %} - <a href='{{ context.copy_url() }}'>{{ i18n.gettext('Make a copy')|u }}</a> + <a href='{{ context.copy_url() }}'>{% trans %}Make a copy{% endtrans %}</a> {% endif %} </div> <input type="hidden" name="@template" value="item">
--- a/share/roundup/templates/jinja2/html/issue.item.html Mon Jan 13 09:36:40 2020 +0100 +++ b/share/roundup/templates/jinja2/html/issue.item.html Mon Jan 13 21:18:42 2020 +0000 @@ -2,7 +2,7 @@ {% block head_title %} {% if context.id %} - Issue {{ context.id }}: {{ context.title.plain()|u|e }} - {{ config.TRACKER_NAME }} + Issue {{ context.id }}: {{ context.title.plain()|u }} - {{ config.TRACKER_NAME }} {% else %} New Issue - {{ config.TRACKER_NAME }} {% endif %} @@ -32,10 +32,10 @@ {% if context.id %} <p> - Created on <b>{{ context.creation.plain()|u|e }}</b> - by <b>{{ context.creator.plain()|u|e }}</b>, - last changed <b>{{ context.activity.reldate()|u|e }}</b> - by <b>{{ context.actor.plain()|u|e }}</b>. + Created on <b>{{ context.creation.plain()|u }}</b> + by <b>{{ context.creator.plain()|u }}</b>, + last changed <b>{{ context.activity.reldate()|u }}</b> + by <b>{{ context.actor.plain()|u }}</b>. </p> {% endif %} @@ -51,7 +51,7 @@ <a href='msg{{ msg.id }}'>msg{{msg.id}} (view)</a> </div> <div class='span4'> - Author: {{ msg.author.plain()|u|e }}, Date: {{ msg.date.plain()|u|e }} + Author: {{ msg.author.plain()|u }}, Date: {{ msg.date.plain()|u }} </div> <div class='pull-right'> {% if context.is_edit_ok %} @@ -66,13 +66,13 @@ </div> </div> <div class='row-fluid'> - <pre>{{ msg.content.hyperlinked()|u }}</pre> + <pre>{{ msg.content.hyperlinked()|u|safe }}</pre> </div> {% endfor %} {% endif %} <div class='vspace-five'></div> - {{ context.history()|u }} + {{ context.history()|u|safe }} {% endblock %}
--- a/share/roundup/templates/jinja2/html/issue.item.readonly.html Mon Jan 13 09:36:40 2020 +0100 +++ b/share/roundup/templates/jinja2/html/issue.item.readonly.html Mon Jan 13 21:18:42 2020 +0000 @@ -1,16 +1,16 @@ <dl class='dl-horizontal'> - <dt>{{ i18n.gettext('Title')|u }}</dt> - <dd>{{ context.title.plain()|u|e }}</dd> - <dt>{{ i18n.gettext('Priority')|u }}</dt> - <dd>{{ context.priority.plain()|u|e }}</dd> - <dt>{{ i18n.gettext('Status')|u }}</dt> - <dd>{{ context.status.plain()|u|e }}</dd> - <dt>{{ i18n.gettext('Superseder')|u }}</dt> - <dd>{{ context.superseder.plain()|u|e }}</dd> - <dt>{{ i18n.gettext('Nosy list')|u }}</dt> - <dd>{{ context.nosy.plain()|u|e }}</dd> - <dt>{{ i18n.gettext('Assigned to')|u }}</dt> - <dd>{{ context.assignedto.plain()|u|e }}</dd> - <dt>{{ i18n.gettext('Keywords')|u }}</dt> - <dd>{{ context.keyword.plain()|u|e }}</dd> + <dt>{% trans %}Title{% endtrans %}</dt> + <dd>{{ context.title.plain()|u }}</dd> + <dt>{% trans %}Priority{% endtrans %}</dt> + <dd>{{ context.priority.plain()|u }}</dd> + <dt>{% trans %}Status{% endtrans %}</dt> + <dd>{{ context.status.plain()|u }}</dd> + <dt>{% trans %}Superseder{% endtrans %}</dt> + <dd>{{ context.superseder.plain()|u }}</dd> + <dt>{% trans %}Nosy list{% endtrans %}</dt> + <dd>{{ context.nosy.plain()|u }}</dd> + <dt>{% trans %}Assigned to{% endtrans %}</dt> + <dd>{{ context.assignedto.plain()|u }}</dd> + <dt>{% trans %}Keywords{% endtrans %}</dt> + <dd>{{ context.keyword.plain()|u }}</dd> </dl>
--- a/share/roundup/templates/jinja2/html/issue.search.html Mon Jan 13 09:36:40 2020 +0100 +++ b/share/roundup/templates/jinja2/html/issue.search.html Mon Jan 13 21:18:42 2020 +0000 @@ -26,7 +26,7 @@ {%- endmacro %} {% macro option_value(option, id, name) -%} <option value="{{ id }}" - {% if id == request.form.getvalue(option, '') %}selected{% endif %} >{{ name|u|e }}</option> + {% if id == request.form.getvalue(option, '') %}selected{% endif %} >{{ name|u }}</option> {%- endmacro %} {% block head_title %} @@ -45,14 +45,14 @@ <tr> <th class="header"> </th> - <th class="header">{{ i18n.gettext('Filter on')|u }}</th> - <th class="header">{{ i18n.gettext('Display')|u }}</th> - <th class="header">{{ i18n.gettext('Sort on')|u }}</th> - <th class="header">{{ i18n.gettext('Group on')|u }}</th> + <th class="header">{% trans %}Filter on{% endtrans %}</th> + <th class="header">{% trans %}Display{% endtrans %}</th> + <th class="header">{% trans %}Sort on{% endtrans %}</th> + <th class="header">{% trans %}Group on{% endtrans %}</th> </tr> <tr> - <th>{{ i18n.gettext('All text*:')|u }}</th> + <th>{% trans %}All text*:{% endtrans %}</th> <td>{{ input('@search_text') }}</td> <td> </td> <td> </td> @@ -60,7 +60,7 @@ </tr> <tr> - <th>{{ i18n.gettext('Title:')|u }}</th> + <th>{% trans %}Title:{% endtrans %}</th> <td>{{ input('title') }}</td> <td>{{ display_column('title') }}</td> <td>{{ sort_column('title') }}</td> @@ -68,7 +68,7 @@ </tr> <tr> - <th>{{ i18n.gettext('Keyword:')|u }}</th> + <th>{% trans %}Keyword:{% endtrans %}</th> <td><select class="custom-select" name="keyword" id="keyword"> {{ option_value('keyword', '', 'don\'t care') }} {{ option_value('keyword', '-1', 'not selected') }} @@ -83,7 +83,7 @@ </tr> <tr> - <th>{{ i18n.gettext('ID:')|u }}</th> + <th>{% trans %}ID:{% endtrans %}</th> <td>{{ input('id') }}</td> <td>{{ display_column('id') }}</td> <td>{{ sort_column('id') }}</td> @@ -91,7 +91,7 @@ </tr> <tr> - <th>{{ i18n.gettext('Creation Date:')|u }}</th> + <th>{% trans %}Creation Date:{% endtrans %}</th> <td>{{ input('creation') }}</td> <td>{{ display_column('creation') }}</td> <td>{{ sort_column('creation') }}</td> @@ -99,7 +99,7 @@ </tr> <tr> - <th>{{ i18n.gettext('Activity:')|u }}</th> + <th>{% trans %}Activity:{% endtrans %}</th> <td>{{ input('activity') }}</td> <td>{{ display_column('activity') }}</td> <td>{{ sort_column('activity') }}</td> @@ -107,7 +107,7 @@ </tr> <tr> - <th>{{ i18n.gettext('Priority:')|u }}</th> + <th>{% trans %}Priority:{% endtrans %}</th> <td><select class="custom-select" name="priority" id="priority"> {{ option_value('priority', '', 'don\'t care') }} {{ option_value('priority', '-1', 'not selected') }} @@ -138,7 +138,7 @@ </tr> <tr> - <th>{{ i18n.gettext('Assigned to:')|u }}</th> + <th>{% trans %}Assigned to:{% endtrans %}</th> <td>{{ input('submitter') }}</td> <td>{{ display_column('assignedto') }}</td> <td>{{ sort_column('assignedto') }}</td> @@ -146,7 +146,7 @@ </tr> <tr> - <th>{{ i18n.gettext('No Sort or group:')|u }}</th> + <th>{% trans %}No Sort or group:{% endtrans %}</th> <td> </td> <td> </td> <td><input type="radio" name="@sort" value=""></td> @@ -154,22 +154,22 @@ </tr> <tr> -<th>{{ i18n.gettext('Pagesize:')|u }}</th> +<th>{% trans %}Pagesize:{% endtrans %}</th> <td><input class="form-control col-4" name="@pagesize" value="{{ request.form.getfirst('@pagesize', '50') }}" /></td> </tr> <tr> -<th>{{ i18n.gettext('Start With:')|u }}</th> +<th>{% trans %}Start With:{% endtrans %}</th> <td><input class="form-control col-4" name="@startwith"" value="{{ request.form.getfirst('@startwith', '0') }}" /></td> </tr> <tr> -<th>{{ i18n.gettext('Sort Descending:')|u }}</th> +<th>{% trans %}Sort Descending:{% endtrans %}</th> <td><input type="checkbox" name="@sortdir" {% if sort_desc %}checked{% endif %} /></td> </tr> <tr> -<th>{{ i18n.gettext('Group Descending:')|u }}</th> +<th>{% trans %}Group Descending:{% endtrans %}</th> <td><input type="checkbox" name="@groupdir" {% if group_desc %}checked{% endif %} /></td> </tr> @@ -183,7 +183,7 @@ <tr><td> </td> <td colspan="4" class="help"> - {{ i18n.gettext('*: The "all text" field will look in message bodies and issue titles')|u }} + {% trans %}*: The "all text" field will look in message bodies and issue titles{% endtrans %} </td> </tr> </table>
--- a/share/roundup/templates/jinja2/html/keyword.item.html Mon Jan 13 09:36:40 2020 +0100 +++ b/share/roundup/templates/jinja2/html/keyword.item.html Mon Jan 13 21:18:42 2020 +0000 @@ -1,28 +1,28 @@ {% extends 'layout/page.html' %} {% block head_title %} - {{ i18n.gettext('Keyword editing')|u }} + {% trans %}Keyword editing{% endtrans %} {% endblock %} {% block page_header %} - {{ i18n.gettext('Keyword editing')|u }} + {% trans %}Keyword editing{% endtrans %} {% endblock %} {% block content %} <h4>Existing Keywords</h4> <p class='text-warning'> - {{ i18n.gettext('To edit an existing keyword (for spelling or typing errors), - click on its entry above.') }} + {% trans %}To edit an existing keyword (for spelling or typing errors), + click on its entry above.{% endtrans %} </p> <ul class='nav nav-pills nav-stacked'> {% for keyword in db.keyword.list() %} <li> - <a href='keyword{{ keyword.id }}'>{{ keyword.name.plain()|u|e }}</a> + <a href='keyword{{ keyword.id }}'>{{ keyword.name.plain()|u }}</a> </li> {% else %} - <p class='text-mute'>{{ i18n.gettext('There are no keywords yet. Be the first -')|u }}</p> + <p class='text-mute'>{% trans %}There are no keywords yet. Be the first -{% endtrans %}</p> {% endfor %} </ul> @@ -33,6 +33,6 @@ <input name="@csrf" type="hidden" value="{{ utils.anti_csrf_nonce() }}"> <input type="hidden" name="@action" value="new"> - <input type='submit' class='btn btn-primary' value="{{ i18n.gettext('Create keyword')|u }}"> + <input type='submit' class='btn btn-primary' value="{% trans %}Create keyword{% endtrans %}"> </form> {% endblock %}
--- a/share/roundup/templates/jinja2/html/layout/banner.html Mon Jan 13 09:36:40 2020 +0100 +++ b/share/roundup/templates/jinja2/html/layout/banner.html Mon Jan 13 21:18:42 2020 +0000 @@ -1,14 +1,14 @@ <div class="navbar navbar-ligh bg-light"> <a href="/" class='navbar-brand'> - <i class='icon-home'></i> {{ i18n.gettext('Roundup Demo Tracker')|u }} + <i class='icon-home'></i> {% trans %}Roundup Demo Tracker{% endtrans %} </a> - <form name="searchform" method="get" action="bug" class='form-inline my-2 my-lg-0 navbar-search pull-right'> + <form name="searchform" method="get" action="issue" class='form-inline my-2 my-lg-0 navbar-search pull-right'> <input type="hidden" name="@columns" value="{{ bug_columns_showall }}"/> <input type="hidden" name="@sort" value="-activity"> <input type="hidden" name="@group" value="priority"> <input type="hidden" name="@filter" value="status"> <input type="hidden" name="status" value="{{ bug_status_notclosed }}"/> <input class="form-control mr-sm-2 input-medium search-query" id="search-text" type="search" name="@search_text"> - <input class="form-control my-2 my-sm-0" type="submit" value="{{ i18n.gettext('search in open bugs')|u }}" name="submit" class='btn'> + <input class="form-control my-2 my-sm-0" type="submit" value="{% trans %}search in open bugs{% endtrans %}" name="submit" class='btn'> </form> </div> <!-- navbar -->
--- a/share/roundup/templates/jinja2/html/layout/footer.html Mon Jan 13 09:36:40 2020 +0100 +++ b/share/roundup/templates/jinja2/html/layout/footer.html Mon Jan 13 21:18:42 2020 +0000 @@ -1,8 +1,8 @@ <footer> <div class='container-fluid'> <hr> - {{ i18n.gettext('A')|u }} - <a href='http://www.roundup-tracker.org/'>{{ i18n.gettext('roundup')|u }}</a> - {{ i18n.gettext('production')|u }}. + {% trans %}A{% endtrans %} + <a href='http://www.roundup-tracker.org/'>{% trans %}roundup{% endtrans %}</a> + {% trans %}production{% endtrans %}. </div> </footer>
--- a/share/roundup/templates/jinja2/html/layout/navigation.html Mon Jan 13 09:36:40 2020 +0100 +++ b/share/roundup/templates/jinja2/html/layout/navigation.html Mon Jan 13 21:18:42 2020 +0000 @@ -3,18 +3,18 @@ {% if request.user.hasPermission('View', 'query') %} <p> - <b>{{ i18n.gettext('Your Queries')|u }}</b> (<a href="query?@template=edit">{{ i18n.gettext('edit')|u }}</a>) + <b>{% trans %}Your Queries{% endtrans %}</b> (<a href="query?@template=edit">{% trans %}edit{% endtrans %}</a>) </p> {% endif %} {% if request.user.hasPermission('View', 'issue') %} <ul class='nav flex-column'> <li class='nav-header'> - <i class='icon-fire'></i>{{ i18n.gettext('Issues')|u }} + <i class='icon-fire'></i>{% trans %}Issues{% endtrans %} </li> {% if request.user.hasPermission('Create', 'issue') %} <li> - <a href="issue?@template=item">{{ i18n.gettext('Create New')|u }}</a> + <a href="issue?@template=item">{% trans %}Create New{% endtrans %}</a> </li> {% endif %} @@ -28,7 +28,7 @@ 'status': status_notresolved, 'assignedto': '-1', '@dispname': i18n.gettext('Show Unassigned')|u, - }) }}">{{ i18n.gettext('Show Unassigned')|u }}</a> + }) }}">{% trans %}Show Unassigned{% endtrans %}</a> </li> <li class="nav-item"> <a href="{{ request.indexargs_url('issue', { @@ -39,10 +39,10 @@ '@search_text': '', 'status': status_notresolved, '@dispname': i18n.gettext('Show All')|u, - }) }}">{{ i18n.gettext('Show All')|u }}</a> + }) }}">{% trans %}Show All{% endtrans %}</a> </li> <li> - <a href="issue?@template=search">{{ i18n.gettext('Search')|u }}</a> + <a href="issue?@template=search">{% trans %}Search{% endtrans %}</a> </li> <li> <form method="POST" class='form-inline' action="{{ request.base }}"> @@ -50,31 +50,31 @@ <input type="hidden" name="@type" value="issue"> <input type="hidden" name="@action" value="show"> <input class="form-control input-sm col-2" type="text" name="@number"> - <input type="submit" class="form-control col-auto" value="{{ i18n.gettext('Show issue')|u }}"> + <input type="submit" class="form-control col-auto" value="{% trans %}Show issue{% endtrans %}"> </div> </form> </li> </ul> <hr> {% else %} - <p class='text-error'>{{ i18n.gettext("You don't have permission to view issues.") }}</p> + <p class='text-error'>{% trans %}You don't have permission to view issues.{% endtrans %}</p> {% endif %} <ul class='nav flex-column'> {% if request.user.hasPermission('Create', 'keyword') or request.user.hasPermission('Edit', 'keyword') %} <li class='nav-header'> - <i class='icon-star'></i>{{ i18n.gettext('Keywords')|u }} + <i class='icon-star'></i>{% trans %}Keywords{% endtrans %} </li> {% endif %} {% if request.user.hasPermission('Create', 'keyword') %} <li class="nav-item"> - <a href="keyword?@template=item">{{ i18n.gettext('Create New')|u }}</a> + <a href="keyword?@template=item">{% trans %}Create New{% endtrans %}</a> </li> {% endif %} {% if request.user.hasPermission('Edit', 'keyword') %} <li class="nav-item"> - <a href="keyword?@template=item">{{ i18n.gettext('Edit Existing')|u }}</a> + <a href="keyword?@template=item">{% trans %}Edit Existing{% endtrans %}</a> </li> {% endif %} </ul> @@ -86,24 +86,24 @@ {% if request.user.hasPermission('View', 'user') %} <ul class='nav flex-column'> <li class='nav-header'> - <i class='icon-eye-open'></i>{{ i18n.gettext('Administration')|u }} + <i class='icon-eye-open'></i>{% trans %}Administration{% endtrans %} </li> {% if request.user.hasPermission('Edit', None) %} <li> - <a href="home?@template=classlist">{{ i18n.gettext('Class List')|u }}</a> + <a href="home?@template=classlist">{% trans %}Class List{% endtrans %}</a> </li> {% endif %} {% if request.user.hasPermission('View', 'user') or request.user.hasPermission('Edit', 'user') %} <li> - <a href="user">{{ i18n.gettext('User List')|u }}</a> + <a href="user">{% trans %}User List{% endtrans %}</a> </li> {% endif %} {% if request.user.hasPermission('Create', 'user') %} <li> - <a href="user?@template=item">{{ i18n.gettext('Add User')|u }}</a> + <a href="user?@template=item">{% trans %}Add User{% endtrans %}</a> </li> {% endif %} </ul> @@ -114,7 +114,7 @@ <form method="POST" action='{{ request.base }}'> <ul class='nav flex-column'> <li class='nav-header'> - <i class='icon-user'></i>{{ i18n.gettext('Login')|u }} + <i class='icon-user'></i>{% trans %}Login{% endtrans %} </li> <li class="nav-item"> <input class="form-control" type='text' name="__login_name" placeholder='username'> @@ -124,19 +124,19 @@ </li> <li class="nav-item"> <label class="form-control" class='checkbox'> - <input type="checkbox" name="remember"> {{ i18n.gettext('Remember me?')|u }} + <input type="checkbox" name="remember"> {% trans %}Remember me?{% endtrans %} </label> </li> <li class="nav-item"> - <input class="form-control" type="submit" value="{{ i18n.gettext('Login')|u }}" class='btn btn-inverse'> + <input class="form-control" type="submit" value="{% trans %}Login{% endtrans %}" class='btn btn-inverse'> </li> <li class='vspace-one'> {% if request.user.hasPermission('Register', 'user') %} - <a href="user?@template=register">{{ i18n.gettext('Register')|u }}</a> + <a href="user?@template=register">{% trans %}Register{% endtrans %}</a> {% endif %} </li> <li class="nav-item"> - <a href="user?@template=forgotten">{{ i18n.gettext('Lost your login?')|u }}</a> + <a href="user?@template=forgotten">{% trans %}Lost your login?{% endtrans %}</a> </li> </ul> <input type="hidden" name="@action" value="Login"> @@ -146,7 +146,7 @@ {% else %} <ul class='nav flex-column'> <li class='nav-header'> - <i class='icon-user'></i>{{ i18n.gettext('Hello,')|u }} + <i class='icon-user'></i>{% trans %}Hello,{% endtrans %} <span class='username'>{{ request.user.username.plain(escape=1) }}</span> </li> <li> @@ -159,13 +159,13 @@ 'status': status_notresolved, 'assignedto': request.user.id, '@dispname': i18n.gettext('Your Issues')|u, - }) }}">{{ i18n.gettext('Your Issues')|u }}</a> + }) }}">{% trans %}Your Issues{% endtrans %}</a> </li> <li> - <a href="user{{ request.user.id }}">{{ i18n.gettext('Your Details')|u }}</a> + <a href="user{{ request.user.id }}">{% trans %}Your Details{% endtrans %}</a> </li> <li> - <a href="{{ request.indexargs_url('', {'@action':'logout'}) }}">{{ i18n.gettext('Logout')|u }}</a> + <a href="{{ request.indexargs_url('', {'@action':'logout'}) }}">{% trans %}Logout{% endtrans %}</a> </li> </ul> <hr> @@ -173,7 +173,7 @@ <ul class='nav flex-column'> <li class='nav-header'> - <i class='icon-bookmark'></i>{{ i18n.gettext('Help')|u }} + <i class='icon-bookmark'></i>{% trans %}Help{% endtrans %} </li> <li> <a href="http://www.roundup-tracker.org">Roundup docs</a>
--- a/share/roundup/templates/jinja2/html/layout/pagination.html Mon Jan 13 09:36:40 2020 +0100 +++ b/share/roundup/templates/jinja2/html/layout/pagination.html Mon Jan 13 21:18:42 2020 +0000 @@ -4,28 +4,28 @@ {% if batch and batch.previous %} <li class="page-item"> <a class="page-link" href="{{ request.indexargs_url(request.classname, - {'@startwith':batch.previous().first, '@pagesize':batch.previous().size}) }}">{{ i18n.gettext('Previous')|u }}</a> + {'@startwith':batch.previous().first, '@pagesize':batch.previous().size}) }}">{% trans %}Previous{% endtrans %}</a> </li> {% else %} <li class='page-item disabled'> - <a class="page-link" href="#">{{ i18n.gettext('Previous')|u }}</a> + <a class="page-link" href="#">{% trans %}Previous{% endtrans %}</a> </li> {% endif %} <li class="page-item disabled"> <span class="page-link"> {{ batch.start }}...{{ batch.start + batch.length -1 }} - {{ i18n.gettext('out of')|u }} + {% trans %}out of{% endtrans %} {{ batch.sequence_length }} </span> </li> {% if batch and batch.next() %} <li class="page-item"> <a class="page-link" href="{{ request.indexargs_url(request.classname, - {'@startwith':batch.next().first, '@pagesize':batch.next().size}) }}">{{ i18n.gettext('Next')|u }}</a> + {'@startwith':batch.next().first, '@pagesize':batch.next().size}) }}">{% trans %}Next{% endtrans %}</a> </li> {% else %} <li class='page-item disabled'> - <a class="page-link" href="#">{{ i18n.gettext('Next')|u }}</a> + <a class="page-link" href="#">{% trans %}Next{% endtrans %}</a> </li> {% endif %} </ul>
--- a/share/roundup/templates/jinja2/html/layout/permission.html Mon Jan 13 09:36:40 2020 +0100 +++ b/share/roundup/templates/jinja2/html/layout/permission.html Mon Jan 13 21:18:42 2020 +0000 @@ -1,13 +1,13 @@ {% if not (context.is_view_ok() or request.user.hasRole('Anonymous')) %} <p class='alert alert-block alert-error fade in'> - {{ i18n.gettext('You are not allowed to view this page.')|u }} + {% trans %}You are not allowed to view this page.{% endtrans %} <button type='button' class='close' data-dismiss='alert'>X</button> </p> {% endif %} {% if not context.is_view_ok() and request.user.hasRole('Anonymous') %} <p class='alert alert-block alert-error fade in'> - {{ i18n.gettext('Please login with your username and password.')|u }} + {% trans %}Please login with your username and password.{% endtrans %} <button type='button' class='close' data-dismiss='alert'>X</button> </p> {% endif %}
--- a/share/roundup/templates/jinja2/html/layout/sort.html Mon Jan 13 09:36:40 2020 +0100 +++ b/share/roundup/templates/jinja2/html/layout/sort.html Mon Jan 13 21:18:42 2020 +0000 @@ -2,7 +2,7 @@ <form method="GET" action='{{ request.classname }}'> <div class='form-group row'> <div class='col-1'> - <span class="float-right">{{ i18n.gettext('Sort on')|u }}</span> + <span class="float-right">{% trans %}Sort on{% endtrans %}</span> </div> <fieldset class="form-group"> {% for i in range(2) %} @@ -26,7 +26,7 @@ </div> <div class='form-group row'> <div class='col-1'> - <span class="float-right">{{ i18n.gettext('Group on')|u }}</span> + <span class="float-right">{% trans %}Group on{% endtrans %}</span> </div> <fieldset class="form-group"> {% for i in range(2) %} @@ -49,7 +49,7 @@ </fieldset> </div> <div class='form-actions'> - <input type='submit' value='{{ i18n.gettext("Redisplay") }}' class='btn btn-primary'> - {{ request.indexargs_form(sort=0, group=0) }} + <input type='submit' value='{% trans %}Redisplay{% endtrans %}' class='btn btn-primary'> + {{ request.indexargs_form(sort=0, group=0)|u|safe }} </div> </form>
--- a/share/roundup/templates/jinja2/html/msg.index.html Mon Jan 13 09:36:40 2020 +0100 +++ b/share/roundup/templates/jinja2/html/msg.index.html Mon Jan 13 21:18:42 2020 +0000 @@ -1,11 +1,11 @@ {% extends 'layout/page.html' %} {% block head_title %} - {{ i18n.gettext('List of messages')|u }} + {% trans %}List of messages{% endtrans %} {% endblock %} {% block page_header %} - {{ i18n.gettext('List of messages')|u }} + {% trans %}List of messages{% endtrans %} {% endblock %} {% block content %} @@ -13,11 +13,11 @@ {% for msg in context.list() %} <div class='row-fluid'> <dl class='span5 dl-horizontal'> - <dt>{{ i18n.gettext('Author')|u }}</dt> - <dd>{{ msg.author.plain()|u|e }}</dd> - <dt>{{ i18n.gettext('Date')|u }}</dt> - <dd>{{ msg.date.plain()|u|e }}</dd> - <dt>{{ i18n.gettext('Message id')|u }}</dt> + <dt>{% trans %}Author{% endtrans %}</dt> + <dd>{{ msg.author.plain()|u }}</dd> + <dt>{% trans %}Date{% endtrans %}</dt> + <dd>{{ msg.date.plain()|u }}</dd> + <dt>{% trans %}Message id{% endtrans %}</dt> <dd>{{ msg.id }}</dd> </dl> <div class='span7'>
--- a/share/roundup/templates/jinja2/html/msg.item.html Mon Jan 13 09:36:40 2020 +0100 +++ b/share/roundup/templates/jinja2/html/msg.item.html Mon Jan 13 21:18:42 2020 +0000 @@ -2,21 +2,21 @@ {% block head_title %} {% if context.id %} - {{ i18n.gettext('Message')|u }} {{ context.id }} - {{ config.TRACKER_NAME }} + {% trans %}Message{% endtrans %} {{ context.id }} - {{ config.TRACKER_NAME }} {% else %} - {{ i18n.gettext('New Message')|u }} - {{ config.TRACKER_NAME }} + {% trans %}New Message{% endtrans %} - {{ config.TRACKER_NAME }} {% endif %} {% endblock %} {% block page_header %} {% if not (context.id or context.is_edit_ok()) %} - {{ i18n.gettext('New Message')|u }} + {% trans %}New Message{% endtrans %} {% elif not context.id and context.is_edit_ok() %} - {{ i18n.gettext('New Message Editing')|u }} + {% trans %}New Message Editing{% endtrans %} {% elif context.id and not context.is_edit_ok() %} - {{ i18n.gettext('Message')|u }}{{ context.id }} + {% trans %}Message{% endtrans %}{{ context.id }} {% elif context.id and context.is_edit_ok() %} - {{ i18n.gettext('Message')|u }}{{ context.id }} {{ i18n.gettext('editing')|u }} + {% trans %}Message{% endtrans %}{{ context.id }} {% trans %}editing{% endtrans %} {% endif %} {% endblock %} @@ -26,17 +26,17 @@ {% if context.is_view_ok() %} <dl class='dl-horizontal'> - <dt>{{ i18n.gettext('Author')|u }}</dt> - <dd>{{ context.author.plain()|u|e }} </dd> - <dt>{{ i18n.gettext('Recipients')|u }}</dt> - <dd>{{ context.recipients.plain()|u|e }}</dd> - <dt>{{ i18n.gettext('Date')|u }}</dt> - <dd>{{ context.date.plain()|u|e }}</dd> + <dt>{% trans %}Author{% endtrans %}</dt> + <dd>{{ context.author.plain()|u }} </dd> + <dt>{% trans %}Recipients{% endtrans %}</dt> + <dd>{{ context.recipients.plain()|u }}</dd> + <dt>{% trans %}Date{% endtrans %}</dt> + <dd>{{ context.date.plain()|u }}</dd> </dl> <div class='row-fluid'> <h4>Content</h4> - <pre>{{ context.content.hyperlinked()|u }}</pre> + <pre>{{ context.content.hyperlinked()|u|safe }}</pre> </div> {% endif %} @@ -45,6 +45,6 @@ {% endif %} <div class='vspace-five'></div> - {{ context.history()|u }} + {{ context.history()|u|safe }} {% endblock %}
--- a/share/roundup/templates/jinja2/html/user.forgotten.html Mon Jan 13 09:36:40 2020 +0100 +++ b/share/roundup/templates/jinja2/html/user.forgotten.html Mon Jan 13 21:18:42 2020 +0000 @@ -1,42 +1,42 @@ {% extends 'layout/page.html' %} {% block head_title %} - {{ i18n.gettext('Password reset request')|u }} - {{ config.TRACKER_NAME }} + {% trans %}Password reset request{% endtrans %} - {{ config.TRACKER_NAME }} {% endblock %} {% block page_header %} - {{ i18n.gettext('Password reset request')|u }} + {% trans %}Password reset request{% endtrans %} {% endblock %} {% block content %} <p> - {{ i18n.gettext('If you know the email address you registered with, enter it below.')|u }} + {% trans %}If you know the email address you registered with, enter it below.{% endtrans %} </p> <form method="POST" action='{{ context.designator() }}'> <div class='row-fluid'> - <label>{{ i18n.gettext('Email Address')|u }}:</label> + <label>{% trans %}Email Address{% endtrans %}:</label> <input type='text' name="address"> <input name="@csrf" type="hidden" value="{{ utils.anti_csrf_nonce() }}"> <input type="hidden" name="@action" value="passrst"> <input type="hidden" name="@template" value="forgotten"> - <input type="submit" value="{{ i18n.gettext('Password reset')|u }}" class='btn btn-primary'> + <input type="submit" value="{% trans %}Password reset{% endtrans %}" class='btn btn-primary'> </div> <div class='row-fluid vspace-two'> - <p>{{ i18n.gettext('Or, if you know your username, then enter it below')|u }}.</p> - <label>{{ i18n.gettext('Username')|u }}:</label> + <p>{% trans %}Or, if you know your username, then enter it below{% endtrans %}.</p> + <label>{% trans %}Username{% endtrans %}:</label> <input type='text' name="username"> - <input type="submit" value="{{ i18n.gettext('Password reset')|u }}" class='btn btn-info'> + <input type="submit" value="{% trans %}Password reset{% endtrans %}" class='btn btn-info'> </div> </form> <div class='row-fluid vspace-two'> <p> - {{ i18n.gettext('A confirmation email will be sent to you - - please follow the instructions within it to complete the reset process.') }} + {% trans %}A confirmation email will be sent to you - + please follow the instructions within it to complete the reset process.{% endtrans %} </p> </div>
--- a/share/roundup/templates/jinja2/html/user.index.html Mon Jan 13 09:36:40 2020 +0100 +++ b/share/roundup/templates/jinja2/html/user.index.html Mon Jan 13 21:18:42 2020 +0000 @@ -1,11 +1,11 @@ {% extends 'layout/page.html' %} {% block head_title %} - {{ i18n.gettext('User listing')|u }} - {{ config.TRACKER_NAME }} + {% trans %}User listing{% endtrans %} - {{ config.TRACKER_NAME }} {% endblock %} {% block page_header %} - {{ i18n.gettext('User listing')|u }} + {% trans %}User listing{% endtrans %} {% endblock %} {% block content %} @@ -15,24 +15,24 @@ {% if context.is_view_ok() %} <table class='table'> <tr class='info'> - <td>{{ i18n.gettext('Username')|u }}</td> - <td>{{ i18n.gettext('Real name')|u }}</td> - <td>{{ i18n.gettext('Organisation')|u }}</td> - <td>{{ i18n.gettext('Email address')|u }}</td> - <td>{{ i18n.gettext('Phone number')|u }}</td> + <td>{% trans %}Username{% endtrans %}</td> + <td>{% trans %}Real name{% endtrans %}</td> + <td>{% trans %}Organisation{% endtrans %}</td> + <td>{% trans %}Email address{% endtrans %}</td> + <td>{% trans %}Phone number{% endtrans %}</td> {% if context.is_retire_ok() %} - <td>{{ i18n.gettext('Retire')|u }}</td> + <td>{% trans %}Retire{% endtrans %}</td> {% endif %} </tr> {% for user in context.list() %} <tr> <td> - <a href='user{{ user.id }}'>{{ user.username.plain()|u|e }}</a> + <a href='user{{ user.id }}'>{{ user.username.plain()|u }}</a> </td> - <td>{{ user.realname.plain()|u|e }}</td> - <td>{{ user.organisation.plain()|u|e }}</td> - <td>{{ user.address.email()|u|e }}</td> - <td>{{ user.phone.plain()|u|e }}</td> + <td>{{ user.realname.plain()|u }}</td> + <td>{{ user.organisation.plain()|u }}</td> + <td>{{ user.address.email()|u }}</td> + <td>{{ user.phone.plain()|u }}</td> {% if context.is_retire_ok() %} <td> <form method="POST" action='user{{ user.id }}' class='form-inline'> @@ -40,7 +40,7 @@ <input name="@csrf" type="hidden" value="{{ utils.anti_csrf_nonce() }}"> <input type="hidden" name="@action" value="retire"> - <input type="submit" value="{{ i18n.gettext('retire')|u }}" class='btn btn-sm btn-danger'> + <input type="submit" value="{% trans %}retire{% endtrans %}" class='btn btn-sm btn-danger'> </form> </td> {% endif %}
--- a/share/roundup/templates/jinja2/html/user.item.html Mon Jan 13 09:36:40 2020 +0100 +++ b/share/roundup/templates/jinja2/html/user.item.html Mon Jan 13 21:18:42 2020 +0000 @@ -2,21 +2,21 @@ {% block head_title %} {% if context.id %} - {{ i18n.gettext('User')|u }} {{ context.id }} - {{ config.TRACKER_NAME }} + {% trans %}User{% endtrans %} {{ context.id }} - {{ config.TRACKER_NAME }} {% else %} - {{ i18n.gettext('New User')|u }} - {{ config.TRACKER_NAME }} + {% trans %}New User{% endtrans %} - {{ config.TRACKER_NAME }} {% endif %} {% endblock %} {% block page_header %} {% if not (context.id or context.is_edit_ok()) %} - {{ i18n.gettext('New User')|u }} + {% trans %}New User{% endtrans %} {% elif not context.id and context.is_edit_ok() %} - {{ i18n.gettext('New User Editing')|u }} + {% trans %}New User Editing{% endtrans %} {% elif context.id and not context.is_edit_ok() %} - {{ i18n.gettext('User')|u }}{{ context.id }} + {% trans %}User{% endtrans %}{{ context.id }} {% elif context.id and context.is_edit_ok() %} - {{ i18n.gettext('User')|u }}{{ context.id }} {{ i18n.gettext('editing')|u }} + {% trans %}User{% endtrans %}{{ context.id }} {% trans %}editing{% endtrans %} {% endif %} {% endblock %} @@ -31,26 +31,26 @@ action ='{{ context.designator() }}'> <table> <tr> - <th>{{ i18n.gettext('Name')|u }}</th> + <th>{% trans %}Name{% endtrans %}</th> <td> - <input class="form-control" type='text' name="realname" value='{{ context.realname.plain()|u|e }}'> + <input class="form-control" type='text' name="realname" value='{{ context.realname.plain()|u }}'> </td> </tr> <tr> - <th>{{ i18n.gettext('Login Name')|u }}</th> + <th>{% trans %}Login Name{% endtrans %}</th> <td> - <input class="form-control" type='text' name='username' value='{{ context.username.plain()|u|e }}'> + <input class="form-control" type='text' name='username' value='{{ context.username.plain()|u }}'> </td> </tr> {% if context.is_edit_ok() %} <tr> - <th>{{ i18n.gettext('Login Password')|u }}</th> + <th>{% trans %}Login Password{% endtrans %}</th> <td> <input class="form-control" type='password' name='password'> </td> </tr> <tr> - <th>{{ i18n.gettext('Confirm Password')|u }}</th> + <th>{% trans %}Confirm Password{% endtrans %}</th> <td> <input class="form-control" type='password' name='@confirm@password'> </td> @@ -58,49 +58,49 @@ {% endif %} {% if request.user.hasPermission('Web Roles') %} <tr> - <th>{{ i18n.gettext('Roles <br>(comma separated)')|u }}</th> + <th>{% trans %}Roles <br>(comma separated){% endtrans %}</th> <td> - <input class="form-control" type='text' name='roles' value='{{ context.roles.plain()|u|e }}'> + <input class="form-control" type='text' name='roles' value='{{ context.roles.plain()|u }}'> </td> </tr> {% endif %} <tr> - <th>{{ i18n.gettext('Phone')|u }}</th> + <th>{% trans %}Phone{% endtrans %}</th> <td> - <input class="form-control" type='text' name='phone' value='{{ context.phone.plain()|u|e }}'> + <input class="form-control" type='text' name='phone' value='{{ context.phone.plain()|u }}'> </td> </tr> <tr> - <th>{{ i18n.gettext('Organisation')|u }}</th> + <th>{% trans %}Organisation{% endtrans %}</th> <td> - <input class="form-control" type='text' name='organisation' value='{{ context.organisation.plain()|u|e }}'> + <input class="form-control" type='text' name='organisation' value='{{ context.organisation.plain()|u }}'> </td> </tr> {% if context.timezone %} <tr> - <th>{{ i18n.gettext('Timezone')|u }}</th> + <th>{% trans %}Timezone{% endtrans %}</th> <td> - <input class="form-control" type='text' name='timezone' value='{{ context.timezone.plain()|u|e }}'> + <input class="form-control" type='text' name='timezone' value='{{ context.timezone.plain()|u }}'> </td> </tr> {% endif %} <tr> - <th>{{ i18n.gettext('Email')|u }}</th> + <th>{% trans %}Email{% endtrans %}</th> <td> - <input class="form-control" type='text' name='address' value='{{ context.address.plain()|u|e }}'> + <input class="form-control" type='text' name='address' value='{{ context.address.plain()|u }}'> </td> </tr> <tr> - <th>{{ i18n.gettext('Alternate email address <br>One address per line')|u }}</th> + <th>{% trans %}Alternate email address <br>One address per line{% endtrans %}</th> <td> - {{ context.alternate_addresses.multiline(class="form-control")|u }} + {{ context.alternate_addresses.multiline(class="form-control")|u|safe }} </td> </tr> {% if context.is_edit_ok() %} <tr class='form-actions'> <td> <input type="hidden" name="@template" value="item"> - {{ context.submit(html_kwargs={ "class": "btn btn-success" }) }} + {{ context.submit(html_kwargs={ "class": "btn btn-success" })|u|safe }} </td> </tr> {% endif %} @@ -108,6 +108,6 @@ </form> {% endif %} - {{ context.history()|u }} + {{ context.history()|u|safe }} {% endblock %}
--- a/share/roundup/templates/jinja2/html/user.register.html Mon Jan 13 09:36:40 2020 +0100 +++ b/share/roundup/templates/jinja2/html/user.register.html Mon Jan 13 21:18:42 2020 +0000 @@ -1,11 +1,11 @@ {% extends 'layout/page.html' %} {% block head_title %} - {{ i18n.gettext('Registration')|u }} - {{ config.TRACKER_NAME }} + {% trans %}Registration{% endtrans %} - {{ config.TRACKER_NAME }} {% endblock %} {% block page_header %} - {{ i18n.gettext('Registration')|u }} - {{ config.TRACKER_NAME }} + {% trans %}Registration{% endtrans %} - {{ config.TRACKER_NAME }} {% endblock %} {% block content %} @@ -18,65 +18,65 @@ value="{{ utils.timestamp() }}" > <table> <tr> - <th>{{ i18n.gettext('Name')|u }}</th> + <th>{% trans %}Name{% endtrans %}</th> <td> <input type='text' name="realname"> </td> </tr> <tr> - <th>{{ i18n.gettext('Login Name')|u }}</th> + <th>{% trans %}Login Name{% endtrans %}</th> <td> <input type='text' name='username' required> </td> </tr> <tr> - <th>{{ i18n.gettext('Login Password')|u }}</th> + <th>{% trans %}Login Password{% endtrans %}</th> <td> <input type='password' name='password' required> </td> </tr> <tr> - <th>{{ i18n.gettext('Confirm Password')|u }}</th> + <th>{% trans %}Confirm Password{% endtrans %}</th> <td> <input type='password' name='@confirm@password'> </td> </tr> {% if request.user.hasPermission('Web Roles') %} <tr> - <th>{{ i18n.gettext('Roles <br>(comma separated)')|u }}</th> + <th>{% trans %}Roles <br>(comma separated){% endtrans %}</th> <td> - <input type='text' name='roles' value='{{ context.roles.plain()|u|e }}'> + <input type='text' name='roles' value='{{ context.roles.plain()|u }}'> </td> </tr> {% endif %} <tr> - <th>{{ i18n.gettext('Phone')|u }}</th> + <th>{% trans %}Phone{% endtrans %}</th> <td> <input type='text' name='phone'> </td> </tr> <tr> - <th>{{ i18n.gettext('Organisation')|u }}</th> + <th>{% trans %}Organisation{% endtrans %}</th> <td> <input type='text' name='organisation'> </td> </tr> <tr> - <th>{{ i18n.gettext('Timezone')|u }}</th> + <th>{% trans %}Timezone{% endtrans %}</th> <td> <input type='text' name='timezone'> </td> </tr> <tr> - <th>{{ i18n.gettext('Email')|u }}</th> + <th>{% trans %}Email{% endtrans %}</th> <td> <input type='text' name='address' required> </td> </tr> <tr> - <th>{{ i18n.gettext('Alternate email address <br>One address per line')|u }}</th> + <th>{% trans %}Alternate email address <br>One address per line{% endtrans %}</th> <td> - {{ context.alternate_addresses.multiline()|u }} + {{ context.alternate_addresses.multiline()|u|safe }} </td> </tr> <tr class='form-actions'> @@ -85,7 +85,7 @@ <input name="@csrf" type="hidden" value="{{ utils.anti_csrf_nonce() }}"> <input type="hidden" name="@action" value="register"> - <input type="submit" name="submit" value="{{ i18n.gettext('Register')|u }}"> + <input type="submit" name="submit" value="{% trans %}Register{% endtrans %}"> </td> </tr> </table>
--- a/share/roundup/templates/jinja2/html/user.rego_progress.html Mon Jan 13 09:36:40 2020 +0100 +++ b/share/roundup/templates/jinja2/html/user.rego_progress.html Mon Jan 13 21:18:42 2020 +0000 @@ -1,17 +1,17 @@ {% extends 'layout/page.html' %} {% block head_title %} - {{ i18n.gettext('Registration in progress')|u }} - {{ config.TRACKER_NAME }} + {% trans %}Registration in progress{% endtrans %} - {{ config.TRACKER_NAME }} {% endblock %} {% block page_header %} - {{ i18n.gettext('Registration in progress...')|u }} + {% trans %}Registration in progress...{% endtrans %} {% endblock %} {% block content %} <p> - {{ i18n.gettext('You will shortly receive an email to confirm your + {% trans %}You will shortly receive an email to confirm your registration. To complete the registration process, - visit the link indicated in the email.') }} + visit the link indicated in the email.{% endtrans %} </p> {% endblock %}
