Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use translate and blocktranslate template tags #2114

Merged
merged 3 commits into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 26 additions & 26 deletions evap/contributor/templates/contributor_evaluation_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{% load evaluation_filters %}

{% block title %}{% trans 'Your EvaP' %} - {{ block.super }}{% endblock %}
{% block title %}{% translate 'Your EvaP' %} - {{ block.super }}{% endblock %}

{% block breadcrumb_bar %}
<div class="breadcrumb-bar">
Expand All @@ -18,9 +18,9 @@

<div class="callout callout-info small">
{% if editable %}
{% blocktrans %}Please review the evaluation's details below, add all contributors and select suitable questionnaires. Once everything is okay, please approve the evaluation on the bottom of the page.{% endblocktrans %}
{% blocktranslate %}Please review the evaluation's details below, add all contributors and select suitable questionnaires. Once everything is okay, please approve the evaluation on the bottom of the page.{% endblocktranslate %}
{% else %}
{% blocktrans %}You cannot edit this evaluation because it has already been approved.{% endblocktrans %}
{% blocktranslate %}You cannot edit this evaluation because it has already been approved.{% endblocktranslate %}
{% endif %}
</div>
<h3>
Expand All @@ -31,29 +31,29 @@ <h3>
{% csrf_token %}
<div class="card mb-3">
<div class="card-body">
<h5 class="card-title">{% trans 'Course data' %}</h5>
<h5 class="card-title">{% translate 'Course data' %}</h5>
<div class="d-flex">
<label class="col-md-3 pe-4 form-label">{% trans 'Name (German)' %}</label>
<label class="col-md-3 pe-4 form-label">{% translate 'Name (German)' %}</label>
<div class="col-md-7 form-static-text">{{ evaluation.course.name_de }}</div>
</div>
<div class="d-flex">
<label class="col-md-3 pe-4 form-label">{% trans 'Name (English)' %}</label>
<label class="col-md-3 pe-4 form-label">{% translate 'Name (English)' %}</label>
<div class="col-md-7 form-static-text">{{ evaluation.course.name_en }}</div>
</div>
<div class="d-flex">
<label class="col-md-3 pe-4 form-label">{% trans 'Responsibles' %}</label>
<label class="col-md-3 pe-4 form-label">{% translate 'Responsibles' %}</label>
<div class="col-md-7 form-static-text">{{ evaluation.course.responsibles_names }}</div>
</div>
<div class="d-flex">
<label class="col-md-3 pe-4 form-label">{% trans 'Degrees' %}</label>
<label class="col-md-3 pe-4 form-label">{% translate 'Degrees' %}</label>
<div class="col-md-7 form-static-text">
{% for degree in evaluation.course.degrees.all %}
<span class="badge bg-primary">{{ degree }}</span>
{% endfor %}
</div>
</div>
<div class="d-flex">
<label class="col-md-3 pe-4 form-label">{% trans 'Course type' %}</label>
<label class="col-md-3 pe-4 form-label">{% translate 'Course type' %}</label>
<div class="col-md-7 form-static-text">
<span class="badge bg-secondary">{{ evaluation.course.type }}</span>
</div>
Expand All @@ -63,17 +63,17 @@ <h5 class="card-title">{% trans 'Course data' %}</h5>
<div class="card mb-3">
<div class="card-body table-responsive">
<div class="d-flex">
<h5 class="card-title me-auto">{% trans 'Evaluation data' %}</h5>
<h5 class="card-title me-auto">{% translate 'Evaluation data' %}</h5>
{% if evaluation.allow_editors_to_edit %}
<div>
<button type="button" class="btn btn-sm btn-light mb-3 createAccountRequestModalShowButton">
{% trans 'Request creation of new account' %}
{% translate 'Request creation of new account' %}
</button>
</div>
{% else %}
<div>
<button type="button" class="btn btn-sm btn-light changeEvaluationRequestModalShowButton">
{% trans 'Request changes' %}
{% translate 'Request changes' %}
</button>
</div>
{% endif %}
Expand All @@ -90,22 +90,22 @@ <h5 class="card-title me-auto">{% trans 'Evaluation data' %}</h5>
<div class="card card-submit-area card-submit-area-3 text-center mb-3">
<div class="card-body">
{% if editable %}
<button name="operation" value="preview" type="submit" class="btn btn-light">{% trans 'Preview' %}</button>
<button name="operation" value="save" type="submit" class="btn btn-primary">{% trans 'Save' %}</button>
<button name="operation" value="preview" type="submit" class="btn btn-light">{% translate 'Preview' %}</button>
<button name="operation" value="save" type="submit" class="btn btn-primary">{% translate 'Save' %}</button>

<confirmation-modal type="submit" name="operation" value="approve">
<span slot="title">{% trans 'Approve evaluation' %}</span>
<span slot="action-text">{% trans 'Approve evaluation' %}</span>
<span slot="title">{% translate 'Approve evaluation' %}</span>
<span slot="action-text">{% translate 'Approve evaluation' %}</span>
<span slot="question">
{% blocktrans trimmed %}
{% blocktranslate trimmed %}
Do you want to approve this evaluation? This will allow the evaluation team to proceed with the preparation, but you won't be able to make any further changes.
{% endblocktrans %}
{% endblocktranslate %}
</span>

<button slot="show-button" type="button" class="btn btn-success">{% trans 'Save and approve' %}</button>
<button slot="show-button" type="button" class="btn btn-success">{% translate 'Save and approve' %}</button>
</confirmation-modal>
{% endif %}
<a href="{% url 'contributor:index' %}" class="btn btn-light">{% if edit %}{% trans 'Cancel' %}{% else %}{% trans 'Back' %}{% endif %}</a>
<a href="{% url 'contributor:index' %}" class="btn btn-light">{% if edit %}{% translate 'Cancel' %}{% else %}{% translate 'Back' %}{% endif %}</a>
</div>
</div>
</form>
Expand All @@ -115,14 +115,14 @@ <h5 class="card-title me-auto">{% trans 'Evaluation data' %}</h5>
<div class="modal-dialog modal-xl" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="previewModalLabel">{% trans 'Preview' %}</h5>
<h5 class="modal-title" id="previewModalLabel">{% translate 'Preview' %}</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
{{ preview_html }}
</div>
<div class="modal-footer">
<button type="button" class="btn btn-light" data-bs-dismiss="modal">{% trans 'Close' %}</button>
<button type="button" class="btn btn-light" data-bs-dismiss="modal">{% translate 'Close' %}</button>
</div>
</div>
</div>
Expand All @@ -133,12 +133,12 @@ <h5 class="modal-title" id="previewModalLabel">{% trans 'Preview' %}</h5>
{% block modals %}
{{ block.super }}

{% blocktrans asvar title with evaluation_name=evaluation.full_name %}Request account creation for {{ evaluation_name }}{% endblocktrans %}
{% trans 'Please tell us which new account we should create. We need the name and email for all new accounts.' as teaser %}
{% blocktranslate asvar title with evaluation_name=evaluation.full_name %}Request account creation for {{ evaluation_name }}{% endblocktranslate %}
{% translate 'Please tell us which new account we should create. We need the name and email for all new accounts.' as teaser %}
{% include 'contact_modal.html' with modal_id='createAccountRequestModal' user=request.user title=title teaser=teaser %}

{% blocktrans asvar title with evaluation_name=evaluation.full_name %}Request evaluation changes for {{ evaluation_name }}{% endblocktrans %}
{% trans 'Please tell us what changes to the evaluation we should make.' as teaser %}
{% blocktranslate asvar title with evaluation_name=evaluation.full_name %}Request evaluation changes for {{ evaluation_name }}{% endblocktranslate %}
{% translate 'Please tell us what changes to the evaluation we should make.' as teaser %}
{% include 'contact_modal.html' with modal_id='changeEvaluationRequestModal' user=request.user title=title teaser=teaser %}
{% endblock %}

Expand Down
Loading
Loading