Allow translating text in templates

This commit is contained in:
rubenwardy
2022-01-07 23:27:00 +00:00
parent c8b0f9e6ce
commit c5a6ae3035
60 changed files with 415 additions and 349 deletions

View File

@@ -14,7 +14,7 @@
{% if token %}
<form class="float-right" method="POST" action="{{ url_for('api.delete_token', username=token.owner.username, id=token.id) }}">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
<input class="btn btn-danger" type="submit" value="Delete">
<input class="btn btn-danger" type="submit" value="{{ _('Delete') }}">
</form>
{% endif %}
@@ -30,15 +30,14 @@
<div class="card-header">{{ _("Access Token") }}</div>
<div class="card-body">
<p>
For security reasons, access tokens will only be shown once.
Reset the token if it is lost.
{{ _("For security reasons, access tokens will only be shown once. Reset the token if it is lost.") }}
</p>
{% if access_token %}
<input class="form-control my-3" type="text" readonly value="{{ access_token }}" class="form-control">
{% endif %}
<form method="POST" action="{{ url_for('api.reset_token', username=token.owner.username, id=token.id) }}">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
<input class="btn btn-primary" type="submit" value="Reset">
<input class="btn btn-primary" type="submit" value="{{ _('Reset') }}">
</form>
</div>
</div>

View File

@@ -5,8 +5,8 @@
{% endblock %}
{% block pane %}
<a class="btn btn-primary float-right" href="{{ url_for('api.create_edit_token', username=user.username) }}">Create</a>
<a class="btn btn-secondary mr-2 float-right" href="/help/api/">API Documentation</a>
<a class="btn btn-primary float-right" href="{{ url_for('api.create_edit_token', username=user.username) }}">{{ _("Create") }}</a>
<a class="btn btn-secondary mr-2 float-right" href="/help/api/">{{ _("API Documentation") }}</a>
<h2 class="mt-0">{{ _("API Tokens") }}</h2>
<div class="list-group">
@@ -16,7 +16,7 @@
</a>
{% else %}
<span class="list-group-item">
<i>No tokens created</i>
<i>{{ _("No tokens created") }}</i>
</span>
{% endfor %}
</div>