[enh] configurable localization

This commit is contained in:
asciimoo 2014-01-22 00:59:18 +01:00
parent a6c31ef7e6
commit 852dfc77c6
7 changed files with 55 additions and 12 deletions

View file

@ -1,7 +1,7 @@
<div id="categories">
{% for category in categories %}
<div class="checkbox_container">
<input type="checkbox" id="checkbox_{{ category|replace(' ', '_') }}" name="category_{{ category }}" {% if category in selected_categories %}checked="checked"{% endif %} /><label for="checkbox_{{ category|replace(' ', '_') }}">{{ category }}</label>
<input type="checkbox" id="checkbox_{{ category|replace(' ', '_') }}" name="category_{{ category }}" {% if category in selected_categories %}checked="checked"{% endif %} /><label for="checkbox_{{ category|replace(' ', '_') }}">{{ _(category) }}</label>
</div>
{% endfor %}
</div>

View file

@ -5,15 +5,25 @@
<h2>{{ _('Preferences') }}</h2>
<form method="post" action="/preferences" id="search_form">
<fieldset>
<legend>{{ _('Default categories') }}</legend>
<form method="post" action="/preferences" id="search_form">
<p>
{% include 'categories.html' %}
</p>
<input type="submit" value="{{ _('save') }}" />
</form>
</fieldset>
<fieldset>
<legend>{{ _('Interface language') }}</legend>
<p>
<select name='locale'>
{% for locale_id,locale_name in locales.items() %}
<option value={{ locale_id }} {% if locale_id == current_locale %}selected="selected"{% endif %}>{{ locale_name}}</option>
{% endfor %}
</select>
</p>
</fieldset>
<input type="submit" value="{{ _('save') }}" />
</form>
<div class="right"><a href="/">{{ _('back') }}</a></div>
</div>
{% endblock %}