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

View File

@ -5,8 +5,8 @@
{% endblock %} {% endblock %}
{% block pane %} {% 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-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-secondary mr-2 float-right" href="/help/api/">{{ _("API Documentation") }}</a>
<h2 class="mt-0">{{ _("API Tokens") }}</h2> <h2 class="mt-0">{{ _("API Tokens") }}</h2>
<div class="list-group"> <div class="list-group">
@ -16,7 +16,7 @@
</a> </a>
{% else %} {% else %}
<span class="list-group-item"> <span class="list-group-item">
<i>No tokens created</i> <i>{{ _("No tokens created") }}</i>
</span> </span>
{% endfor %} {% endfor %}
</div> </div>

View File

@ -190,10 +190,10 @@
</form> </form>
</li> </li>
<li class="dropdown-divider"></li> <li class="dropdown-divider"></li>
<li class="nav-item"> <li class="nav-item ">
<a class="nav-link" href="https://github.com/minetest/contentdb/issues/156"> <a class="nav-link" href="https://hosted.weblate.org/projects/minetest/contentdb/">
<small> <small>
Help make more of CDB translatable {{ _("Help translate ContentDB") }}
</small> </small>
</a> </a>
</li> </li>

View File

@ -16,15 +16,15 @@
<p> <p>
<a class="btn" href="{{ notification.url | abs_url }}"> <a class="btn" href="{{ notification.url | abs_url }}">
View Notification {{ _("View Notification") }}
</a> </a>
</p> </p>
{% endblock %} {% endblock %}
{% block footer %} {% block footer %}
You are receiving this email because you are a registered user of ContentDB, {{ _("You are receiving this email because you are a registered user of ContentDB, and have email notifications enabled.") }}
and have email notifications enabled. <br> <br>
<a href="{{ abs_url_for('users.email_notifications', username=notification.user.username) }}"> <a href="{{ abs_url_for('users.email_notifications', username=notification.user.username) }}">
{{ _("Manage your preferences") }} {{ _("Manage your preferences") }}

View File

@ -19,15 +19,15 @@
<p style="margin-top: 3em;"> <p style="margin-top: 3em;">
<a class="btn" href="{{ abs_url_for('notifications.list_all') }}"> <a class="btn" href="{{ abs_url_for('notifications.list_all') }}">
View Notifications {{ _("View Notifications") }}
</a> </a>
</p> </p>
{% endblock %} {% endblock %}
{% block footer %} {% block footer %}
You are receiving this email because you are a registered user of ContentDB, {{ _("You are receiving this email because you are a registered user of ContentDB, and have email notifications enabled.") }}
and have email notifications enabled. <br> <br>
<a href="{{ abs_url_for('users.email_notifications', username=user.username) }}"> <a href="{{ abs_url_for('users.email_notifications', username=user.username) }}">
{{ _("Manage your preferences") }} {{ _("Manage your preferences") }}

View File

@ -1,33 +1,34 @@
{% extends "emails/base.html" %} {% extends "emails/base.html" %}
{% block content %} {% block content %}
<h2 style="margin-top: 0;">Hello!</h2> <h2 style="margin-top: 0;">{{ _("Hello!") }}</h2>
<p> <p>
This email has been sent to you because someone (hopefully you) {{ _("This email has been sent to you because someone (hopefully you) has entered your email address as a user's email.") }}
has entered your email address as a user's email.
</p> </p>
<p> <p>
If it wasn't you, then just delete this email. {{ _("If it wasn't you, then just delete this email.") }}
</p> </p>
<p> <p>
If this was you, then please click this link to confirm the address: {{ _("If this was you, then please click this link to confirm the address:") }}
</p> </p>
<a class="btn" href="{{ abs_url_for('users.verify_email', token=token) }}"> <a class="btn" href="{{ abs_url_for('users.verify_email', token=token) }}">
Confirm Email Address {{ _("Confirm Email Address") }}
</a> </a>
<p style="font-size: 80%;"> <p style="font-size: 80%;">
Or paste this into your browser: <code>{{ abs_url_for('users.verify_email', token=token) }}</code> {{ _("Or paste this into your browser:") }}
<code>{{ abs_url_for('users.verify_email', token=token) }}</code>
<p> <p>
{% endblock %} {% endblock %}
{% block footer %} {% block footer %}
You are receiving this email because someone (hopefully you) entered your email address as a user's email. <br> {{ _("You are receiving this email because someone (hopefully you) entered your email address as a user's email.") }}
<br>
<a href="{{ abs_url_for('users.unsubscribe', token=sub.token) }}"> <a href="{{ abs_url_for('users.unsubscribe', token=sub.token) }}">
{{ _("Unsubscribe") }} {{ _("Unsubscribe") }}
</a> </a>

View File

@ -1,22 +1,24 @@
{% extends "emails/base.html" %} {% extends "emails/base.html" %}
{% block content %} {% block content %}
<h2 style="margin-top: 0;">Hello!</h2> <h2 style="margin-top: 0;">
{{ _("Hello!") }}
</h2>
<p> <p>
We're sorry to see you go. You just need to do one more thing before your email is blacklisted. {{ _("We're sorry to see you go. You just need to do one more thing before your email is blacklisted.") }}
</p> </p>
<a class="btn" href="{{ abs_url_for('users.unsubscribe', token=sub.token) }}"> <a class="btn" href="{{ abs_url_for('users.unsubscribe', token=sub.token) }}">
Unsubscribe {{ _("Unsubscribe") }}
</a> </a>
<p style="font-size: 80%;"> <p style="font-size: 80%;">
Or paste this into your browser: <code>{{ abs_url_for('users.unsubscribe', token=sub.token) }}</code> {{ _("Or paste this into your browser:") }} <code>{{ abs_url_for('users.unsubscribe', token=sub.token) }}</code>
<p> <p>
{% endblock %} {% endblock %}
{% block footer %} {% block footer %}
You are receiving this email because someone (hopefully you) entered your email address in the unsubscribe form. {{ _("You are receiving this email because someone (hopefully you) entered your email address in the unsubscribe form.") }}
{% endblock %} {% endblock %}

View File

@ -29,7 +29,7 @@
<span class="pl-2">{{ entry.causer.username }}</span> <span class="pl-2">{{ entry.causer.username }}</span>
{% else %} {% else %}
<i>Deleted User</i> <i>{{ _("Deleted User") }}</i>
{% endif %} {% endif %}
</div> </div>
@ -61,7 +61,7 @@
</div> </div>
</a> </a>
{% else %} {% else %}
<p class="list-group-item"><i>No audit log entires.</i></p> <p class="list-group-item"><i>{{ _("No audit log entries.") }}</i></p>
{% endfor %} {% endfor %}
</div> </div>
{% endmacro %} {% endmacro %}

View File

@ -49,7 +49,7 @@
</div> </div>
{{ field(class_=fieldclass or 'form-control', **kwargs) }} {{ field(class_=fieldclass or 'form-control', **kwargs) }}
<a class="btn btn-secondary" id="{{ field.name }}-button"> <a class="btn btn-secondary" id="{{ field.name }}-button">
View {{ _("View") }}
</a> </a>
</div> </div>
@ -104,7 +104,7 @@
<label for="{{ field.id }}">{{ label|safe }}</label> <label for="{{ field.id }}">{{ label|safe }}</label>
{% endif %} {% endif %}
<div class="multichoice_selector bulletselector form-control"> <div class="multichoice_selector bulletselector form-control">
<input type="text" placeholder="Start typing to see suggestions"> <input type="text" placeholder="{{ _('Start typing to see suggestions') }}">
<div class="clearboth"></div> <div class="clearboth"></div>
</div> </div>
<div class="invalid-remaining invalid-feedback"></div> <div class="invalid-remaining invalid-feedback"></div>

View File

@ -2,7 +2,7 @@
<div class="row mb-4"> <div class="row mb-4">
<span class="col"> <span class="col">
State: <strong>{{ package.state.value }}</strong> {{ _("State") }}: <strong>{{ package.state.value }}</strong>
</span> </span>
{% for state in package.getNextStates(current_user) %} {% for state in package.getNextStates(current_user) %}
@ -18,9 +18,13 @@
{% set message %} {% set message %}
{% if package.checkPerm(current_user, "MAKE_RELEASE") %} {% if package.checkPerm(current_user, "MAKE_RELEASE") %}
{% if package.update_config %} {% if package.update_config %}
<a class="btn btn-sm btn-warning float-right" href="{{ package.getURL("packages.create_release") }}">Create first release</a> <a class="btn btn-sm btn-warning float-right" href="{{ package.getURL("packages.create_release") }}">
{{ _("Create first release") }}
</a>
{% else %} {% else %}
<a class="btn btn-sm btn-warning float-right" href="{{ package.getURL("packages.setup_releases") }}">Set up releases</a> <a class="btn btn-sm btn-warning float-right" href="{{ package.getURL("packages.setup_releases") }}">
{{ _("Set up releases") }}
</a>
{% endif %} {% endif %}
{{ _("You need to create a release before this package can be approved.") }} {{ _("You need to create a release before this package can be approved.") }}
{% else %} {% else %}
@ -29,36 +33,38 @@
{% endset %} {% endset %}
{% elif (package.type == package.type.GAME or package.type == package.type.TXP) and package.screenshots.count() == 0 %} {% elif (package.type == package.type.GAME or package.type == package.type.TXP) and package.screenshots.count() == 0 %}
{% set message = "You need to add at least one screenshot." %} {% set message = _("You need to add at least one screenshot.") %}
{% elif package.getMissingHardDependenciesQuery().count() > 0 %} {% elif package.getMissingHardDependenciesQuery().count() > 0 %}
{% set deps = package.getMissingHardDependencies() | join(", ") %} {% set deps = package.getMissingHardDependencies() | join(", ") %}
{% set message = "The following hard dependencies need to be added to ContentDB first: " + deps %} {% set message = _("The following hard dependencies need to be added to ContentDB first: %(deps)s", deps) %}
{% elif topic_error_lvl == "danger" %} {% elif topic_error_lvl == "danger" %}
{% elif package.state == package.state.READY_FOR_REVIEW and ("Other" in package.license.name or "Other" in package.media_license.name) %} {% elif package.state == package.state.READY_FOR_REVIEW and ("Other" in package.license.name or "Other" in package.media_license.name) %}
{% set message = "Please wait for the license to be added to CDB." %} {% set message = _("Please wait for the license to be added to CDB.") %}
{% else %} {% else %}
{% set level = "info" %} {% set level = "info" %}
{% set message %} {% set message %}
{% if package.screenshots.count() == 0 %} {% if package.screenshots.count() == 0 %}
<b>You should add at least one screenshot, but this isn't required.</b><br /> <b>
{{ _("You should add at least one screenshot, but this isn't required.") }}
</b><br />
{% endif %} {% endif %}
{% if package.state == package.state.READY_FOR_REVIEW %} {% if package.state == package.state.READY_FOR_REVIEW %}
{% if not package.getDownloadRelease() %} {% if not package.getDownloadRelease() %}
Please wait for the release to be approved. {{ _("Please wait for the release to be approved.") }}
{% elif package.checkPerm(current_user, "APPROVE_NEW") %} {% elif package.checkPerm(current_user, "APPROVE_NEW") %}
You can now approve this package if you're ready. {{ _("You can now approve this package if you're ready.") }}
{% else %} {% else %}
Please wait for the package to be approved. {{ _("Please wait for the package to be approved.") }}
{% endif %} {% endif %}
{% else %} {% else %}
{% if package.checkPerm(current_user, "EDIT_PACKAGE") %} {% if package.checkPerm(current_user, "EDIT_PACKAGE") %}
You can now submit this package for approval if you're ready. {{ _("You can now submit this package for approval if you're ready.") }}
{% else %} {% else %}
This package can be submitted for approval when ready. {{ _("This package can be submitted for approval when ready.") }}
{% endif %} {% endif %}
{% endif %} {% endif %}
{% endset %} {% endset %}
@ -88,16 +94,18 @@
More info More info
</a> </a>
{% if conflicting_modnames | length > 4 %} {% if conflicting_modnames | length > 4 %}
Please make sure that this package has the right to the names it uses. {{ _("Please make sure that this package has the right to the names it uses.") }}
{% else %} {% else %}
Please make sure that this package has the right to the names {{ conflicting_modnames | join(", ") }}. {{ _("Please make sure that this package has the right to the names %(names)s", names=conflicting_modnames | join(", ")) }}.
{% endif %} {% endif %}
</div> </div>
{% endif %} {% endif %}
{% if not package.review_thread and (package.author == current_user or package.checkPerm(current_user, "APPROVE_NEW")) %} {% if not package.review_thread and (package.author == current_user or package.checkPerm(current_user, "APPROVE_NEW")) %}
<div class="alert alert-secondary"> <div class="alert alert-secondary">
<a class="float-right btn btn-sm btn-secondary" href="{{ url_for('threads.new', pid=package.id, title='Package approval comments') }}">Open Thread</a> <a class="float-right btn btn-sm btn-secondary" href="{{ url_for('threads.new', pid=package.id, title='Package approval comments') }}">
{{ _("Open Thread") }}
</a>
{{ _("Package review thread") }}: {{ _("Package review thread") }}:
{{ _("You can open a thread if you have a question for the reviewer or package author.") }} {{ _("You can open a thread if you have a question for the reviewer or package author.") }}

View File

@ -22,15 +22,15 @@
{% if not package.license.is_foss and not package.media_license.is_foss and package.type != package.type.TXP %} {% if not package.license.is_foss and not package.media_license.is_foss and package.type != package.type.TXP %}
<p style="color:#f33;"> <p style="color:#f33;">
<b>Warning:</b> Non-free code and media. {{ _("<b>Warning:</b> Non-free code and media.") }}
</p> </p>
{% elif not package.license.is_foss and package.type != package.type.TXP %} {% elif not package.license.is_foss and package.type != package.type.TXP %}
<p style="color:#f33;"> <p style="color:#f33;">
<b>Warning:</b> Non-free code. {{ _("<b>Warning:</b> Non-free code.") }}
</p> </p>
{% elif not package.media_license.is_foss %} {% elif not package.media_license.is_foss %}
<p style="color:#f33;"> <p style="color:#f33;">
<b>Warning:</b> Non-free media. {{ _("<b>Warning:</b> Non-free media.") }}
</p> </p>
{% endif %} {% endif %}
</div> </div>
@ -42,7 +42,7 @@
{% for p in packages %} {% for p in packages %}
{{ render_pkgtile(p, show_author) }} {{ render_pkgtile(p, show_author) }}
{% else %} {% else %}
<li class="packagetile flex-fill"><i>No packages available</i></li> <li class="packagetile flex-fill"><i>{{ _("No packages available") }}</i></li>
{% endfor %} {% endfor %}
{% if packages %} {% if packages %}
{% for i in range(4) %} {% for i in range(4) %}

View File

@ -17,7 +17,7 @@
[{{ rel.commit_hash | truncate(5, end='') }}] [{{ rel.commit_hash | truncate(5, end='') }}]
{% endif %} {% endif %}
created {{ rel.releaseDate | date }}. {{ _("created %(date)s", date=rel.releaseDate | date) }}.
</small> </small>
</a> </a>
{% endfor %} {% endfor %}
@ -44,7 +44,7 @@
[{{ rel.commit_hash | truncate(5, end='') }}] [{{ rel.commit_hash | truncate(5, end='') }}]
{% endif %} {% endif %}
created {{ rel.releaseDate | date }}. {{ _("created %(date)s", date=rel.releaseDate | date) }}.
</small> </small>
</a> </a>
{% endif %} {% endif %}
@ -55,9 +55,11 @@
{% macro render_releases(releases, package, current_user) -%} {% macro render_releases(releases, package, current_user) -%}
{% for rel in releases %} {% for rel in releases %}
<div class="list-group-item"> <div class="list-group-item">
<a class="btn btn-sm btn-primary float-right" href="{{ rel.getEditURL() }}">Edit <a class="btn btn-sm btn-primary float-right" href="{{ rel.getEditURL() }}">
{% if not rel.task_id and not rel.approved and rel.checkPerm(current_user, "APPROVE_RELEASE") %} {% if not rel.task_id and not rel.approved and rel.checkPerm(current_user, "APPROVE_RELEASE") %}
/ Approve {{ _("Edit / Approve") }}
{% else %}
{{ _("Edit") }}
{% endif %} {% endif %}
</a> </a>
@ -84,17 +86,21 @@
[{{ rel.commit_hash | truncate(5, end='') }}] [{{ rel.commit_hash | truncate(5, end='') }}]
{% endif %} {% endif %}
created {{ rel.releaseDate | date }}. {{ _("created %(date)s", date=rel.releaseDate | date) }}.
</small> </small>
{% if (package.checkPerm(current_user, "MAKE_RELEASE") or rel.checkPerm(current_user, "APPROVE_RELEASE")) and rel.task_id %} {% if (package.checkPerm(current_user, "MAKE_RELEASE") or rel.checkPerm(current_user, "APPROVE_RELEASE")) and rel.task_id %}
<a href="{{ url_for('tasks.check', id=rel.task_id, r=package.getURL("packages.view")) }}">Importing...</a> <a href="{{ url_for('tasks.check', id=rel.task_id, r=package.getURL("packages.view")) }}">
{{ _("Importing...") }}
</a>
{% elif not rel.approved %} {% elif not rel.approved %}
Waiting for approval. {{ _("Waiting for approval.") }}
{% endif %} {% endif %}
{% if not rel.approved %}</i>{% endif %} {% if not rel.approved %}</i>{% endif %}
</div> </div>
{% else %} {% else %}
<div class="list-group-item">No releases available.</div> <div class="list-group-item">
{{ _("No releases available.") }}
</div>
{% endfor %} {% endfor %}
{% endmacro %} {% endmacro %}

View File

@ -129,7 +129,7 @@
by {{ t.author.display_name }} by {{ t.author.display_name }}
</a> </a>
{% else %} {% else %}
<p class="list-group-item"><i>No threads found</i></p> <p class="list-group-item"><i>{{ _("No threads found") }}</i></p>
{% endfor %} {% endfor %}
{% endmacro %} {% endmacro %}
@ -209,6 +209,6 @@
</div> </div>
</a> </a>
{% else %} {% else %}
<p class="list-group-item"><i>No threads found</i></p> <p class="list-group-item"><i>{{ _("No threads found") }}</i></p>
{% endfor %} {% endfor %}
{% endmacro %} {% endmacro %}

View File

@ -54,7 +54,7 @@
</div> </div>
</li> </li>
{% else %} {% else %}
<p class="list-group-item"><i>No outdated packages.</i></p> <p class="list-group-item"><i>{{ _("No outdated packages.") }}</i></p>
{% endfor %} {% endfor %}
</ul> </ul>
{% endmacro %} {% endmacro %}

View File

@ -2,11 +2,11 @@
<table class="table {{ class_ }}"> <table class="table {{ class_ }}">
<tr> <tr>
<th></th> <th></th>
<th>Title</th> <th>{{ _("Title") }}</th>
{% if show_author %}<th>Author</th>{% endif %} {% if show_author %}<th>{{ _("Author") }}</th>{% endif %}
<th>Name</th> <th>{{ _("Name") }}</th>
<th>Date</th> <th>{{ _("Date") }}</th>
<th>Actions</th> <th>{{ _("Actions") }}</th>
</tr> </tr>
{% for topic in topics %} {% for topic in topics %}
<tr class="{% if topic.wip %}wiptopic{% endif %} {% if topic.discarded %}discardtopic{% endif %}"> <tr class="{% if topic.wip %}wiptopic{% endif %} {% if topic.discarded %}discardtopic{% endif %}">
@ -15,7 +15,7 @@
</td> </td>
<td> <td>
<a href="https://forum.minetest.net/viewtopic.php?t={{ topic.topic_id}}">{{ topic.title }}</a> <a href="https://forum.minetest.net/viewtopic.php?t={{ topic.topic_id}}">{{ topic.title }}</a>
{% if topic.wip %}[WIP]{% endif %} {% if topic.wip %}[{{ _("WIP") }}]{% endif %}
</td> </td>
{% if show_author %} {% if show_author %}
<td><a href="{{ url_for('users.profile', username=topic.author.username) }}">{{ topic.author.display_name}}</a></td> <td><a href="{{ url_for('users.profile', username=topic.author.username) }}">{{ topic.author.display_name}}</a></td>
@ -26,15 +26,15 @@
{% if current_user == topic.author or topic.author.checkPerm(current_user, "CHANGE_AUTHOR") %} {% if current_user == topic.author or topic.author.checkPerm(current_user, "CHANGE_AUTHOR") %}
<a class="btn btn-primary" <a class="btn btn-primary"
href="{{ url_for('packages.create_edit', author=topic.author.username, repo=topic.getRepoURL(), forums=topic.topic_id, title=topic.title, bname=topic.name) }}"> href="{{ url_for('packages.create_edit', author=topic.author.username, repo=topic.getRepoURL(), forums=topic.topic_id, title=topic.title, bname=topic.name) }}">
Create {{ _("Create") }}
</a> </a>
{% endif %} {% endif %}
{% if show_discard and current_user.is_authenticated and topic.checkPerm(current_user, "TOPIC_DISCARD") %} {% if show_discard and current_user.is_authenticated and topic.checkPerm(current_user, "TOPIC_DISCARD") %}
<a class="btn btn-{% if topic.discarded %}success{% else %}danger{% endif %} topic-discard" data-tid={{ topic.topic_id }}> <a class="btn btn-{% if topic.discarded %}success{% else %}danger{% endif %} topic-discard" data-tid={{ topic.topic_id }}>
{% if topic.discarded %} {% if topic.discarded %}
Show {{ _("Show") }}
{% else %} {% else %}
Discard {{ _("Discard") }}
{% endif %} {% endif %}
</a> </a>
{% endif %} {% endif %}
@ -53,14 +53,17 @@
{% for topic in topics %} {% for topic in topics %}
<li{% if topic.wip %} class="wiptopic"{% endif %}> <li{% if topic.wip %} class="wiptopic"{% endif %}>
<a href="https://forum.minetest.net/viewtopic.php?t={{ topic.topic_id}}">{{ topic.title }}</a> <a href="https://forum.minetest.net/viewtopic.php?t={{ topic.topic_id}}">{{ topic.title }}</a>
{% if topic.wip %}[WIP]{% endif %} {% if topic.wip %}[{{ _("WIP") }}]{% endif %}
{% if topic.discarded %}[Old]{% endif %} {% if topic.discarded %}[{{ _("Old") }}]{% endif %}
{% if topic.name %}[{{ topic.name }}]{% endif %} {% if topic.name %}[{{ topic.name }}]{% endif %}
{% if show_author %} {% if show_author %}
by <a href="{{ url_for('users.profile', username=topic.author.username) }}">{{ topic.author.display_name }}</a> by <a href="{{ url_for('users.profile', username=topic.author.username) }}">{{ topic.author.display_name }}</a>
{% endif %} {% endif %}
{% if topic.author == current_user or topic.author.checkPerm(current_user, "CHANGE_AUTHOR") %} {% if topic.author == current_user or topic.author.checkPerm(current_user, "CHANGE_AUTHOR") %}
| <a href="{{ url_for('packages.create_edit', author=topic.author.username, repo=topic.getRepoURL(), forums=topic.topic_id, title=topic.title, bname=topic.name) }}">Create</a> |
<a href="{{ url_for('packages.create_edit', author=topic.author.username, repo=topic.getRepoURL(), forums=topic.topic_id, title=topic.title, bname=topic.name) }}">
{{ _("Create") }}
</a>
{% endif %} {% endif %}
</li> </li>
{% endfor %} {% endfor %}

View File

@ -1,7 +1,7 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block title %} {% block title %}
Meta Packages {{ _("Meta Packages") }}
{% endblock %} {% endblock %}
{% block content %} {% block content %}
@ -34,7 +34,7 @@ Meta Packages
</div> </div>
</a> </a>
{% else %} {% else %}
<li><i>No meta packages found.</i></li> <li><i>{{ _("No meta packages found.") }}</i></li>
{% endfor %} {% endfor %}
</div> </div>
{% endblock %} {% endblock %}

View File

@ -1,35 +1,37 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block title %} {% block title %}
{{ mpackage.name }} - Meta Packages {{ mpackage.name }} - {{ _("Meta Packages") }}
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<h1>Meta Package "{{ mpackage.name }}"</h1> <h1>{{ _("Meta Package \"%(name)s\"", name=mpackage.name) }}</h1>
<h2>Provided By</h2> <h2>{{ _("Provided By") }}</h2>
{% from "macros/packagegridtile.html" import render_pkggrid %} {% from "macros/packagegridtile.html" import render_pkggrid %}
{{ render_pkggrid(mpackage.packages.filter_by(state="APPROVED").all()) }} {{ render_pkggrid(mpackage.packages.filter_by(state="APPROVED").all()) }}
{% if similar_topics %} {% if similar_topics %}
<p>Unforuntately, this isn't on ContentDB yet! Here's some forum topics:</p> <p>
{{ _("Unfortunately, this isn't on ContentDB yet! Here's some forum topic(s):") }}
</p>
<ul> <ul>
{% for t in similar_topics %} {% for t in similar_topics %}
<li> <li>
[{{ t.type.value }}] [{{ t.type.value }}]
<a href="https://forum.minetest.net/viewtopic.php?t={{ t.topic_id }}"> <a href="https://forum.minetest.net/viewtopic.php?t={{ t.topic_id }}">
{{ t.title }} by {{ t.author.display_name }} {{ _("%(title)s by %(display_name)s", title=t.title, display_name=t.author.display_name) }}
</a> </a>
{% if t.wip %}[WIP]{% endif %} {% if t.wip %}[{{ _("WIP") }}]{% endif %}
</li> </li>
{% endfor %} {% endfor %}
</ul> </ul>
{% endif %} {% endif %}
<h2>Required By</h2> <h2>{{ _("Required By") }}</h2>
{{ render_pkggrid(dependers) }} {{ render_pkggrid(dependers) }}
<h2>Optionally Used By</h2> <h2>{{ _("Optionally Used By") }}</h2>
{{ render_pkggrid(optional_dependers) }} {{ render_pkggrid(optional_dependers) }}
{% endblock %} {% endblock %}

View File

@ -1,7 +1,7 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block title %} {% block title %}
Notifications {{ _("Notifications") }}
{% endblock %} {% endblock %}
{% block content %} {% block content %}
@ -15,16 +15,16 @@ Notifications
</a> </a>
{% endif %} {% endif %}
<h1>Notifications</h1> <h1>{{ self.title() }}</h1>
{% if current_user.notifications %} {% if current_user.notifications %}
<p> <p>
Newest first. {{ _("Newest first.") }}
</p> </p>
{% endif %} {% endif %}
{% if editor_notifications %} {% if editor_notifications %}
<h2>Your Notifications</h2> <h2>{{ _("Your Notifications") }}</h2>
{% endif %} {% endif %}
<div class="list-group mt-3"> <div class="list-group mt-3">
@ -58,12 +58,12 @@ Notifications
</div> </div>
</a> </a>
{% else %} {% else %}
<p class="list-group-item"><i>No notifications</i></p> <p class="list-group-item"><i>{{ _("No notifications") }}</i></p>
{% endfor %} {% endfor %}
</div> </div>
{% if editor_notifications %} {% if editor_notifications %}
<h2>Editor/Approver Notifications</h2> <h2>{{ _("Editor/Approver Notifications") }}</h2>
<div class="list-group mt-3"> <div class="list-group mt-3">
{% for n in editor_notifications %} {% for n in editor_notifications %}
@ -96,7 +96,7 @@ Notifications
</div> </div>
</a> </a>
{% else %} {% else %}
<p class="list-group-item"><i>No notifications</i></p> <p class="list-group-item"><i>{{ _("No notifications") }}</i></p>
{% endfor %} {% endfor %}
</div> </div>
{% endif %} {% endif %}

View File

@ -9,7 +9,9 @@
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<a class="btn btn-secondary" href="{{ package.getURL("packages.alias_list") }}">Back to Aliases</a> <a class="btn btn-secondary" href="{{ package.getURL("packages.alias_list") }}">
{{ _("Back to Aliases") }}
</a>
{% from "macros/forms.html" import render_field, render_submit_field, render_toggle_field %} {% from "macros/forms.html" import render_field, render_submit_field, render_toggle_field %}
<form method="POST" action="" enctype="multipart/form-data" class="mt-4"> <form method="POST" action="" enctype="multipart/form-data" class="mt-4">

View File

@ -9,7 +9,9 @@
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<a class="btn btn-primary float-right" href="{{ package.getURL("packages.alias_create_edit") }}">Create</a> <a class="btn btn-primary float-right" href="{{ package.getURL("packages.alias_create_edit") }}">
{{ _("Create") }}
</a>
<h1>{{ _("Aliases for %(title)s by %(author)s", title=self.link(), author=package.author.display_name) }}</h1> <h1>{{ _("Aliases for %(title)s by %(author)s", title=self.link(), author=package.author.display_name) }}</h1>
<div class="list-group"> <div class="list-group">
@ -19,7 +21,7 @@
</a> </a>
{% else %} {% else %}
<div class="list-group-item"> <div class="list-group-item">
No aliases {{ _("No aliases") }}
</div> </div>
{% endfor %} {% endfor %}
</div> </div>

View File

@ -1,11 +1,11 @@
{% extends "packages/package_base.html" %} {% extends "packages/package_base.html" %}
{% block title %} {% block title %}
Audit Log {{ _("Audit Log") }}
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<h2 class="mt-0">Audit Log</h2> <h2 class="mt-0">{{ self.title() }}</h2>
{% from "macros/pagination.html" import render_pagination %} {% from "macros/pagination.html" import render_pagination %}
{% from "macros/audit_log.html" import render_audit_log %} {% from "macros/audit_log.html" import render_audit_log %}

View File

@ -5,7 +5,7 @@
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<a class="btn btn-secondary float-right" href="/help/update_config/">Help</a> <a class="btn btn-secondary float-right" href="/help/update_config/">{{ _("Help") }}</a>
<h1 class="mb-5">{{ self.title() }}</h1> <h1 class="mb-5">{{ self.title() }}</h1>
<h2>{{ _("Packages with Update Settings") }}</h2> <h2>{{ _("Packages with Update Settings") }}</h2>

View File

@ -1,26 +1,29 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block title %} {% block title %}
{{ title }} {{ query_hint or _("Packages") }}
{% endblock %}
{% block author_links %}
{% if authors %}
{% for author in authors %}
<a href="{{ url_for('packages.list_all', type=type, author=author[0], q=author[1]) }}">{{ author[0] }}</a>
{% if not loop.last %}
,
{% endif %}
{% endfor %}
{% endif %}
{% endblock %} {% endblock %}
{% block content %} {% block content %}
{% if authors %} {% if authors %}
<p class="alert alert-primary"> <p class="alert alert-primary">
Did you mean to search for packages by {{ _("Did you mean to search for packages by %(authors)s?", authors=self.author_links()) }}
{% for author in authors %}
<a href="{{ url_for('packages.list_all', type=type, author=author[0], q=author[1]) }}">{{ author[0] }}</a>
{% if not loop.last %}
,
{% endif %}
{% endfor %}
?
</p> </p>
{% endif %} {% endif %}
<aside class="mb-5"> <aside class="mb-5">
<p class="text-muted">Filter by tags</p> <p class="text-muted">{{ _("Filter by tags") }}</p>
{% for pair in tags %} {% for pair in tags %}
{% set count = pair[0] %} {% set count = pair[0] %}
@ -53,7 +56,7 @@
{% if topics %} {% if topics %}
<h2 style="margin-top:2em;">More content from the forums</h2> <h2 style="margin-top:2em;">{{ _("More content from the forums") }}</h2>
{% from "macros/topics.html" import render_topics %} {% from "macros/topics.html" import render_topics %}
{{ render_topics(topics, current_user) }} {{ render_topics(topics, current_user) }}

View File

@ -10,7 +10,7 @@
<span class="row m-0 p-0"> <span class="row m-0 p-0">
<span class="col-auto m-0 p-0"> <span class="col-auto m-0 p-0">
<img class="img-fluid user-photo img-thumbnail img-thumbnail-1" <img class="img-fluid user-photo img-thumbnail img-thumbnail-1"
src="{{ package.getThumbnailOrPlaceholder(1) }}" alt="Thumbnail" style="max-height: 20px;"> src="{{ package.getThumbnailOrPlaceholder(1) }}" alt="{{ _('Thumbnail') }}" style="max-height: 20px;">
</span> </span>
<span class="col m-0 p-0 pl-2"> <span class="col m-0 p-0 pl-2">
{{ package.title }} {{ package.title }}

View File

@ -1,14 +1,14 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block title %} {% block title %}
Create a release | {{ package.title }} {{ _("Bulk Change Releases") }} - {{ package.title }}
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<h1>Bulk Change Releases</h1> <h1>{{ self.title() }}</h1>
<p class="mb-5"> <p class="mb-5">
Use this page to set the min and max of all releases for your package. {{ _("Use this page to set the min and max of all releases for your package.") }}
</p> </p>
{% from "macros/forms.html" import render_field, render_submit_field, render_checkbox_field %} {% from "macros/forms.html" import render_field, render_submit_field, render_checkbox_field %}
@ -26,15 +26,16 @@
{{ render_checkbox_field(form.only_change_none) }} {{ render_checkbox_field(form.only_change_none) }}
<p id="minmax_warning" style="color:#f00; display: none;"> <p id="minmax_warning" style="color:#f00; display: none;">
Maximum must be greater than or equal to the minimum! {{ _("Maximum must be greater than or equal to the minimum!") }}
</p> </p>
<p class="mt-3"> <p class="mt-3">
Note: Min and max versions will be used to hide the package on {{ _("Note: Min and max versions will be used to hide the package on
platforms not within the range. platforms not within the range.") }}
You cannot select the oldest version for min or the newest version {{ _("You cannot select the oldest version for min or the newest version
for max as this does not make sense - you can't predict the future.<br /> for max as this does not make sense - you can't predict the future.") }}
Leave both as None if in doubt. <br />
{{ _("Leave both as None if in doubt.") }}
</p> </p>
{{ render_submit_field(form.submit) }} {{ render_submit_field(form.submit) }}

View File

@ -1,7 +1,7 @@
{% extends "packages/package_base.html" %} {% extends "packages/package_base.html" %}
{% block title %} {% block title %}
Edit release - {{ package.title }} {{ _("Edit release") }} - {{ package.title }}
{% endblock %} {% endblock %}
{% block content %} {% block content %}
@ -14,21 +14,22 @@
{% if package.checkPerm(current_user, "MAKE_RELEASE") %} {% if package.checkPerm(current_user, "MAKE_RELEASE") %}
{{ render_field(form.title) }} {{ render_field(form.title) }}
{% else %} {% else %}
Title: {{ release.title }} {{ _("Title") }}: {{ release.title }}
{% endif %} {% endif %}
{% if package.checkPerm(current_user, "CHANGE_RELEASE_URL") %} {% if package.checkPerm(current_user, "CHANGE_RELEASE_URL") %}
{{ render_field(form.url) }} {{ render_field(form.url) }}
{% else %} {% else %}
Url: <a href="{{ release.url }}">{{ release.url }}</a><br /> {{ _("URL") }}: <a href="{{ release.url }}">{{ release.url }}</a><br />
{% endif %} {% endif %}
{% if release.commit_hash %} {% if release.commit_hash %}
Commit Hash: {{ release.commit_hash }}<br /> {{ _("Commit Hash") }}: {{ release.commit_hash }}<br />
{% endif %} {% endif %}
{% if release.task_id %} {% if release.task_id %}
Importing... <a href="{{ url_for('tasks.check', id=release.task_id, r=release.getEditURL()) }}">view task</a><br /> {{ _("Importing...") }}
<a href="{{ url_for('tasks.check', id=release.task_id, r=release.getEditURL()) }}">{{ _("view task") }}</a><br />
{% if package.checkPerm(current_user, "CHANGE_RELEASE_URL") %} {% if package.checkPerm(current_user, "CHANGE_RELEASE_URL") %}
{{ render_field(form.task_id) }} {{ render_field(form.task_id) }}
{% endif %} {% endif %}
@ -38,11 +39,11 @@
{% if release.checkPerm(current_user, "APPROVE_RELEASE") %} {% if release.checkPerm(current_user, "APPROVE_RELEASE") %}
{{ render_checkbox_field(form.approved, class_="my-3") }} {{ render_checkbox_field(form.approved, class_="my-3") }}
{% else %} {% else %}
Approved: {{ release.approved }} {{ _("Approved") }}: {{ release.approved }}
{% endif %} {% endif %}
{% endif %} {% endif %}
<h3 class="mt-5">Supported Minetest versions</h3> <h3 class="mt-5">{{ _("Supported Minetest versions") }}</h3>
<div class="row"> <div class="row">
{{ render_field(form.min_rel, class_="col-sm-6") }} {{ render_field(form.min_rel, class_="col-sm-6") }}
@ -50,18 +51,20 @@
</div> </div>
<p id="minmax_warning" style="color:#f00; display: none;"> <p id="minmax_warning" style="color:#f00; display: none;">
Maximum must be greater than or equal to the minimum! {{ _("Maximum must be greater than or equal to the minimum!") }}
</p> </p>
<p> <p>
Set the minimum and maximum Minetest versions supported. {{ _("Set the minimum and maximum Minetest versions supported.
This release will be hidden to clients outside of that range.<br /> This release will be hidden to clients outside of that range. ") }}
Leave both as None if in doubt. <br />
You can <a href="/help/package_config/">set this automatically</a> in the .conf of your package. {{ _("Leave both as None if in doubt.") }}
{{ _("You can <a href='/help/package_config/'>set this automatically</a> in the .conf of your package.") }}
</p> </p>
<p> <p>
You cannot select the oldest version for min or the newest version {{ _("You cannot select the oldest version for min or the newest version
for max as this does not make sense - you can't predict the future. for max as this does not make sense - you can't predict the future.") }}
</p> </p>
<p class="mt-5"> <p class="mt-5">

View File

@ -37,51 +37,54 @@
<form method="POST" action="" enctype="multipart/form-data"> <form method="POST" action="" enctype="multipart/form-data">
{{ form.hidden_tag() }} {{ form.hidden_tag() }}
<h3>1. Name release</h3> <h3>{{ _("1. Name release") }}</h3>
{{ render_field(form.title, placeholder="Human readable. Eg: 1.0.0 or 2018-05-28") }} {{ render_field(form.title, placeholder=_("Human readable. Eg: 1.0.0 or 2018-05-28")) }}
<h3 class="mt-5">2. Set the content</h3> <h3 class="mt-5">{{ _("2. Set the content") }}</h3>
<p class="mb-0">Method</p> <p class="mb-0">{{ _("Method") }}</p>
{{ render_radio_field(form.uploadOpt) }} {{ render_radio_field(form.uploadOpt) }}
{% if package.repo %} {% if package.repo %}
{{ render_field(form.vcsLabel, placeholder="Leave blank to use default branch", class_="mt-3", {{ render_field(form.vcsLabel, placeholder=_("Leave blank to use default branch"), class_="mt-3",
pattern="[A-Za-z0-9/._-]+") }} pattern="[A-Za-z0-9/._-]+") }}
{% endif %} {% endif %}
{{ render_field(form.fileUpload, fieldclass="form-control-file", class_="mt-3", accept=".zip") }} {{ render_field(form.fileUpload, fieldclass="form-control-file", class_="mt-3", accept=".zip") }}
<p> <p>
Take a look at the <a href="/help/package_config/">Package Configuration and Releases Guide</a> for {{ _("Take a look at the <a href='/help/package_config/'>Package Configuration and Releases Guide</a> for
tips on customising releases. tips on customising releases.") }}
</p> </p>
<h3 class="mt-5">3. Supported Minetest versions</h3> <h3 class="mt-5">{{ _("3. Supported Minetest versions") }}</h3>
<div class="row"> <div class="row">
{{ render_field(form.min_rel, class_="col-sm-6") }} {{ render_field(form.min_rel, class_="col-sm-6") }}
{{ render_field(form.max_rel, class_="col-sm-6") }} {{ render_field(form.max_rel, class_="col-sm-6") }}
</div> </div>
<p id="minmax_warning" class="invalid-feedback">
Maximum must be greater than or equal to the minimum! <p id="minmax_warning" style="color:#f00; display: none;">
{{ _("Maximum must be greater than or equal to the minimum!") }}
</p> </p>
<p> <p>
<i class="fas fa-exclamation-circle mr-2"></i> <i class="fas fa-exclamation-circle mr-2"></i>
The .conf of your package can <a href="/help/package_config/">set this automatically</a>, {{ _("The .conf of your package can <a href='/help/package_config/'>set this automatically</a>,
which will override your selection. which will override your selection.") }}
</p>
<p>
{{ _("Set the minimum and maximum Minetest versions supported.
This release will be hidden to clients outside of that range. ") }}
<br />
{{ _("Leave both as None if in doubt.") }}
</p> </p>
<p> <p>
Set the minimum and maximum Minetest versions supported. {{ _("You cannot select the oldest version for min or the newest version
This release will be hidden to clients outside of that range. for max as this does not make sense - you can't predict the future.") }}
Leave both as None if in doubt.
</p>
<p>
You cannot select the oldest version for min or the newest version
for max as this does not make sense - you can't predict the future.
</p> </p>
<p class="mt-5"> <p class="mt-5">

View File

@ -65,9 +65,15 @@
</p> </p>
<p class="mt-5"> <p class="mt-5">
<a class="btn btn-primary" href="{{ package.getURL("packages.create_edit") }}">Add Git repo</a> <a class="btn btn-primary" href="{{ package.getURL("packages.create_edit") }}">
<a class="btn btn-secondary ml-2" href="{{ package.getURL("packages.create_release") }}">Create releases manually</a> {{ _("Add Git repo") }}
<a class="btn btn-secondary ml-2" href="{{ package.getURL("packages.view") }}">Later</a> </a>
<a class="btn btn-secondary ml-2" href="{{ package.getURL("packages.create_release") }}">
{{ _("Create releases manually") }}
</a>
<a class="btn btn-secondary ml-2" href="{{ package.getURL("packages.view") }}">
{{ _("Later") }}
</a>
</p> </p>
{% endif %} {% endif %}
{% endblock %} {% endblock %}

View File

@ -21,12 +21,12 @@
<a class="btn btn-secondary ml-1" href="{{ package.getURL("packages.bulk_change_release") }}"> <a class="btn btn-secondary ml-1" href="{{ package.getURL("packages.bulk_change_release") }}">
<i class="fas fa-wrench mr-1"></i> <i class="fas fa-wrench mr-1"></i>
Bulk update {{ _("Bulk update") }}
</a> </a>
<a class="btn btn-primary ml-1" href="{{ package.getURL("packages.create_release") }}"> <a class="btn btn-primary ml-1" href="{{ package.getURL("packages.create_release") }}">
<i class="fas fa-plus mr-1"></i> <i class="fas fa-plus mr-1"></i>
Create {{ _("Create") }}
</a> </a>
</p> </p>
{% endif %} {% endif %}

View File

@ -6,24 +6,24 @@ Remove {{ package.title }}
{% block content %} {% block content %}
<form method="POST" action=""> <form method="POST" action="">
<h2 class="mt-0">Remove {{ package.title }}</h2> <h2 class="mt-0">{{ _("Remove %(title)s", title=package.title) }}</h2>
<p> <p>
In order to avoid data loss, you cannot permanently delete packages. {{ _("In order to avoid data loss, you cannot permanently delete packages.
You can remove them from ContentDB, which will cause them to not be You can remove them from ContentDB, which will cause them to not be
visible to any users and they may be permanently deleted in the future. visible to any users and they may be permanently deleted in the future.
The Admin can restore removed packages, if needed. The Admin can restore removed packages, if needed.") }}
</p> </p>
{% if package.approved %} {% if package.approved %}
<p> <p>
Unapproving a package will put it back into Draft, where {{ _("Unapproving a package will put it back into Draft, where
it can be submitted for approval again. it can be submitted for approval again.") }}
</p> </p>
{% endif %} {% endif %}
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" /> <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
<a class="btn btn-secondary float-right" href="{{ package.getURL("packages.view") }}">Cancel</a> <a class="btn btn-secondary float-right" href="{{ package.getURL("packages.view") }}">{{ _("Cancel") }}</a>
<input type="submit" name="delete" value="Remove" class="btn btn-danger mr-2" /> <input type="submit" name="delete" value="Remove" class="btn btn-danger mr-2" />

View File

@ -13,7 +13,7 @@
{% if package.issueTracker %} {% if package.issueTracker %}
<p class="alert alert-secondary"> <p class="alert alert-secondary">
Found a bug? Post on the <a href="{{ package.issueTracker }}">issue tracker</a> instead.<br /> {{ _("Found a bug? Post on the <a href='%{url}s'>issue tracker</a> instead.", url=package.issueTracker) }}<br />
</p> </p>
{% endif %} {% endif %}

View File

@ -1,14 +1,14 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block title %} {% block title %}
Edit screenshot | {{ package.title }} {{ _("Edit screenshot") }} - {{ package.title }}
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<div class="row"> <div class="row">
{% from "macros/forms.html" import render_field, render_submit_field, render_checkbox_field %} {% from "macros/forms.html" import render_field, render_submit_field, render_checkbox_field %}
<form method="POST" action="" enctype="multipart/form-data" class="col-md"> <form method="POST" action="" enctype="multipart/form-data" class="col-md">
<h1>Edit screenshot</h1> <h1>{{ _("Edit screenshot") }}</h1>
{{ form.hidden_tag() }} {{ form.hidden_tag() }}
@ -17,7 +17,7 @@
{% if package.checkPerm(current_user, "APPROVE_SCREENSHOT") %} {% if package.checkPerm(current_user, "APPROVE_SCREENSHOT") %}
{{ render_checkbox_field(form.approved) }} {{ render_checkbox_field(form.approved) }}
{% else %} {% else %}
<p>Approved: {{ screenshot.approved }}</p> <p>{{ _("Approved") }}: {{ screenshot.approved }}</p>
{% endif %} {% endif %}
{{ render_submit_field(form.submit) }} {{ render_submit_field(form.submit) }}

View File

@ -1,11 +1,11 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block title %} {% block title %}
Add a screenshot | {{ package.title }} {{ _("Add a screenshot") }} | {{ package.title }}
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<h1>Add a screenshot</h1> <h1>{{ _("Add a screenshot") }}</h1>
{% from "macros/forms.html" import render_field, render_submit_field %} {% from "macros/forms.html" import render_field, render_submit_field %}
<form method="POST" action="" enctype="multipart/form-data"> <form method="POST" action="" enctype="multipart/form-data">

View File

@ -1,7 +1,7 @@
{% extends "packages/package_base.html" %} {% extends "packages/package_base.html" %}
{% block title %} {% block title %}
Screenshots - {{ package.title }} {{ _("Screenshots") }} - {{ package.title }}
{% endblock %} {% endblock %}
{% block content %} {% block content %}
@ -11,7 +11,7 @@
{{ _("Add Image") }} {{ _("Add Image") }}
</a> </a>
{% endif %} {% endif %}
<h2 class="mt-0">Screenshots</h2> <h2 class="mt-0">{{ _("Screenshots") }}</h2>
<p class="mb-4"> <p class="mb-4">
{{ _("Topmost screenshot will be used as the package thumbnail.") }} {{ _("Topmost screenshot will be used as the package thumbnail.") }}
@ -33,7 +33,7 @@
{{ ss.title }} {{ ss.title }}
{% if not ss.approved %} {% if not ss.approved %}
<div class="text-muted"> <div class="text-muted">
Awaiting review {{ _("Awaiting review") }}
</div> </div>
{% endif %} {% endif %}
</div> </div>
@ -51,7 +51,7 @@
{% endif %} {% endif %}
{% else %} {% else %}
<li class="list-group-item"> <li class="list-group-item">
<i>No screenshots.</i> <i>{{ _("No screenshots.") }}</i>
</li> </li>
{% endfor %} {% endfor %}
</ul> </ul>
@ -59,7 +59,7 @@
<form action="" method="POST" class="form mt-4" role="form"> <form action="" method="POST" class="form mt-4" role="form">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" /> <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
<input type="hidden" name="order" value="" /> <input type="hidden" name="order" value="" />
<input type="submit" value="{{ _("Save Order") }}" class="btn btn-primary"> <input type="submit" value="{{ _('Save Order') }}" class="btn btn-primary">
</form> </form>
<noscript> <noscript>

View File

@ -1,21 +1,21 @@
{% extends "packages/package_base.html" %} {% extends "packages/package_base.html" %}
{% block title %} {% block title %}
Share and Badges {{ _("Share and Badges") }}
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<h2 class="mt-0">{{ self.title() }}</h2> <h2 class="mt-0">{{ self.title() }}</h2>
<h3>Links</h3> <h3>{{ _("Links") }}</h3>
<p> <p>
Review link: {{ _("Review link") }}:
</p> </p>
<pre><code>{{ package.getURL("packages.review", absolute=True) }}</code></pre> <pre><code>{{ package.getURL("packages.review", absolute=True) }}</code></pre>
<h3>Badges</h3> <h3>{{ _("Badges") }}</h3>
<p> <p>
{{ package.makeShield("title") | markdown }} {{ package.makeShield("title") | markdown }}

View File

@ -1,7 +1,7 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block title %} {% block title %}
Modname Uniqueness {{ _("Modname Uniqueness") }}
{% endblock %} {% endblock %}
{% block content %} {% block content %}
@ -9,9 +9,9 @@ Modname Uniqueness
<h2>{{ self.title() }}</h2> <h2>{{ self.title() }}</h2>
{% if packages_modnames %} {% if packages_modnames %}
<h3>Packages sharing provided mods</h3> <h3>{{ _("Packages sharing provided mods") }}</h3>
<p class="text-muted"> <p class="text-muted">
This package contains modnames that are present in the following packages: {{ _("This package contains modnames that are present in the following packages:")
</p> </p>
{% for metapackage, packages in packages_modnames.items() %} {% for metapackage, packages in packages_modnames.items() %}
<h4>{{ metapackage.name }}</h4> <h4>{{ metapackage.name }}</h4>
@ -29,15 +29,15 @@ Modname Uniqueness
{% endif %} {% endif %}
{% if similar_topics %} {% if similar_topics %}
<h3>Similar Forum Topics</h3> <h3>{{ _("Similar Forum Topics") }}</h3>
<ul> <ul>
{% for t in similar_topics %} {% for t in similar_topics %}
<li> <li>
[{{ t.type.value }}] [{{ t.type.value }}]
<a href="https://forum.minetest.net/viewtopic.php?t={{ t.topic_id }}"> <a href="https://forum.minetest.net/viewtopic.php?t={{ t.topic_id }}">
{{ t.title }} by {{ t.author.display_name }} {{ _("%(title)s by %(display_name)s", title=t.title, display_name=t.author.display_name) }}
</a> </a>
{% if t.wip %}[WIP]{% endif %} {% if t.wip %}[{{ _("WIP") }}]{% endif %}
</li> </li>
{% endfor %} {% endfor %}
</ul> </ul>

View File

@ -22,7 +22,7 @@
<form method="POST" action=""> <form method="POST" action="">
{{ form.hidden_tag() }} {{ form.hidden_tag() }}
<h3 class="mt-5">Trigger</h3> <h3 class="mt-5">{{ _("Trigger") }}</h3>
<p class="text-muted"> <p class="text-muted">
{{ _("The trigger is the event that triggers the action.") }} {{ _("The trigger is the event that triggers the action.") }}
@ -35,7 +35,7 @@
hint=_("Currently, the branch name field is only used by the New Commit trigger.")) }} hint=_("Currently, the branch name field is only used by the New Commit trigger.")) }}
<h3 class="mt-5">Action</h3> <h3 class="mt-5">{{ _("Action") }}</h3>
<p class="text-muted"> <p class="text-muted">
{{ _("The action to perform when the trigger happens.") }} {{ _("The action to perform when the trigger happens.") }}

View File

@ -26,11 +26,11 @@
{% block container %} {% block container %}
{% if not package.license.is_foss and not package.media_license.is_foss and package.type != package.type.TXP %} {% if not package.license.is_foss and not package.media_license.is_foss and package.type != package.type.TXP %}
{% set package_warning="Non-free code and media" %} {% set package_warning=_("Non-free code and media") %}
{% elif not package.license.is_foss and package.type != package.type.TXP %} {% elif not package.license.is_foss and package.type != package.type.TXP %}
{% set package_warning="Non-free code" %} {% set package_warning=_("Non-free code") %}
{% elif not package.media_license.is_foss %} {% elif not package.media_license.is_foss %}
{% set package_warning="Non-free media" %} {% set package_warning=_("Non-free media") %}
{% endif %} {% endif %}
{% set release = package.getDownloadRelease() %} {% set release = package.getDownloadRelease() %}
<main> <main>
@ -211,8 +211,7 @@
<h2>{% if review_thread.private %}&#x1f512;{% endif %} {{ review_thread.title }}</h2> <h2>{% if review_thread.private %}&#x1f512;{% endif %} {{ review_thread.title }}</h2>
{% if review_thread.private %} {% if review_thread.private %}
<p><i> <p><i>
This thread is only visible to the package owner and users of {{ _("This thread is only visible to the package owner and users of Approver rank or above.") }}
Approver rank or above.
</i></p> </i></p>
{% endif %} {% endif %}
@ -231,7 +230,7 @@
{% if package.checkPerm(current_user, "ADD_SCREENSHOTS") %} {% if package.checkPerm(current_user, "ADD_SCREENSHOTS") %}
<a href="{{ package.getURL("packages.screenshots") }}" class="btn btn-primary float-right"> <a href="{{ package.getURL("packages.screenshots") }}" class="btn btn-primary float-right">
<i class="fas fa-images mr-1"></i> <i class="fas fa-images mr-1"></i>
Edit {{ _("Edit") }}
</a> </a>
{% endif %} {% endif %}
@ -285,13 +284,13 @@
{% endif %} {% endif %}
{% if current_user.is_authenticated and current_user.rank.atLeast(current_user.rank.ADMIN) %} {% if current_user.is_authenticated and current_user.rank.atLeast(current_user.rank.ADMIN) %}
<a href="{{ package.getURL('packages.review_votes') }}" class="btn btn-secondary">Review Votes</a> <a href="{{ package.getURL('packages.review_votes') }}" class="btn btn-secondary">{{ _("Review Votes") }}</a>
{% endif %} {% endif %}
{{ render_reviews(package.reviews, current_user) }} {{ render_reviews(package.reviews, current_user) }}
{% if packages_uses %} {% if packages_uses %}
<h2>Used By</h2> <h2>{{ _("Used By") }}</h2>
{% from "macros/packagegridtile.html" import render_pkggrid %} {% from "macros/packagegridtile.html" import render_pkggrid %}
{{ render_pkggrid(packages_uses) }} {{ render_pkggrid(packages_uses) }}
{% endif %} {% endif %}
@ -302,7 +301,7 @@
{% set config = package.update_config %} {% set config = package.update_config %}
<div class="alert alert-warning"> <div class="alert alert-warning">
<p class="mt-0 my-1"> <p class="mt-0 my-1">
<b>Package may be outdated</b> <b>{{ _("Package may be outdated") }}</b>
</p> </p>
<p class="mt-0 my-1"> <p class="mt-0 my-1">
{{ config.get_message() }} {{ config.get_message() }}
@ -326,7 +325,7 @@
{% if package_warning %} {% if package_warning %}
<p class="alert alert-danger"> <p class="alert alert-danger">
<a href="/help/non_free/" class="float-right">Info</a> <a href="/help/non_free/" class="float-right">Info</a>
<b>Warning:</b> {{ package_warning }} <b>{{ _("Warning") }}:</b> {{ package_warning }}
</p> </p>
{% endif %} {% endif %}
@ -339,7 +338,8 @@
{%- if dep.package %} {%- if dep.package %}
<a class="badge badge-primary" <a class="badge badge-primary"
href="{{ dep.package.getURL("packages.view") }}"> href="{{ dep.package.getURL("packages.view") }}">
{{ dep.package.title }} by {{ dep.package.author.display_name }} {{ _("%(title)s by %(display_name)s",
title=dep.package.title, display_name=dep.package.author.display_name) }}
</a> </a>
{% elif dep.meta_package %} {% elif dep.meta_package %}
<a class="badge badge-primary" <a class="badge badge-primary"
@ -350,7 +350,7 @@
{{ "Expected package or meta_package in dep!" | throw }} {{ "Expected package or meta_package in dep!" | throw }}
{% endif %} {% endif %}
{% else %} {% else %}
No required dependencies {{ _("No required dependencies") }}
{% endfor %} {% endfor %}
</dd> </dd>
@ -362,7 +362,8 @@
{%- if dep.package %} {%- if dep.package %}
<a class="badge badge-secondary" <a class="badge badge-secondary"
href="{{ dep.package.getURL("packages.view") }}"> href="{{ dep.package.getURL("packages.view") }}">
{{ dep.package.title }} by {{ dep.package.author.display_name }} {{ _("%(title)s by %(display_name)s",
title=dep.package.title, display_name=dep.package.author.display_name) }}
{% elif dep.meta_package %} {% elif dep.meta_package %}
<a class="badge badge-secondary" <a class="badge badge-secondary"
href="{{ url_for('metapackages.view', name=dep.meta_package.name) }}"> href="{{ url_for('metapackages.view', name=dep.meta_package.name) }}">
@ -400,11 +401,11 @@
{% if package.dev_state %} {% if package.dev_state %}
<dd title="{{ package.dev_state.get_desc() }}">{{ package.dev_state.value }}</dd> <dd title="{{ package.dev_state.get_desc() }}">{{ package.dev_state.value }}</dd>
{% else %} {% else %}
<dd><i>Unknown</i></dd> <dd><i>{{ _("Unknown") }}</i></dd>
{% endif %} {% endif %}
<dt>{{ _("Added") }}</dt> <dt>{{ _("Added") }}</dt>
<dd>{{ package.created_at | datetime }}</dd> <dd>{{ package.created_at | datetime }}</dd>
<dt>Maintainers</dt> <dt>{{ _("Maintainers") }}</dt>
<dd> <dd>
{% for user in package.maintainers %} {% for user in package.maintainers %}
<a class="badge badge-secondary" <a class="badge badge-secondary"
@ -421,7 +422,7 @@
{% endif %} {% endif %}
</dd> </dd>
{% if package.provides %} {% if package.provides %}
<dt>Provides</dt> <dt>{{ _("Provides") }}</dt>
<dd>{% for meta in package.provides %} <dd>{% for meta in package.provides %}
<a class="badge badge-secondary" <a class="badge badge-secondary"
href="{{ url_for('metapackages.view', name=meta.name) }}">{{ meta.name }}</a> href="{{ url_for('metapackages.view', name=meta.name) }}">{{ meta.name }}</a>
@ -431,7 +432,7 @@
{% if package.author.donate_url %} {% if package.author.donate_url %}
<a class="btn btn-secondary btn-block my-4" href="{{ package.author.donate_url }}" rel="nofollow"> <a class="btn btn-secondary btn-block my-4" href="{{ package.author.donate_url }}" rel="nofollow">
Like {{ package.author.display_name }}'s work? Donate now! {{ _("Like %(display_name)s's work? Donate now!", display_name=package.author.display_name) }}
</a> </a>
{% endif %} {% endif %}
@ -449,7 +450,7 @@
{{ render_releases_download(releases, package, current_user) }} {{ render_releases_download(releases, package, current_user) }}
{% endif %} {% endif %}
<a class="list-group-item list-group-item-action text-center py-1 text-muted" href="{{ package.getURL("packages.list_releases") }}"> <a class="list-group-item list-group-item-action text-center py-1 text-muted" href="{{ package.getURL("packages.list_releases") }}">
More {{ _("More") }}
</a> </a>
</div> </div>
@ -459,7 +460,7 @@
<a class="btn btn-primary btn-sm mx-1" href="{{ url_for('threads.new', pid=package.id) }}"><i class="fas fa-plus"></i></a> <a class="btn btn-primary btn-sm mx-1" href="{{ url_for('threads.new', pid=package.id) }}"><i class="fas fa-plus"></i></a>
</div> </div>
{% endif %} {% endif %}
Threads {{ _("Threads") }}
</h3> </h3>
<div class="list-group"> <div class="list-group">
{% from "macros/threads.html" import render_compact_threadlist %} {% from "macros/threads.html" import render_compact_threadlist %}
@ -470,12 +471,12 @@
{% if package.approved and current_user != package.author %} {% if package.approved and current_user != package.author %}
<a class="float-right" <a class="float-right"
href="{{ url_for('threads.new', pid=package.id) }}"> href="{{ url_for('threads.new', pid=package.id) }}">
Report a problem with this listing {{ _("Report a problem with this listing") }}
</a> </a>
{% endif %} {% endif %}
{% if package.checkPerm(current_user, "EDIT_PACKAGE") or package.checkPerm(current_user, "APPROVE_NEW") %} {% if package.checkPerm(current_user, "EDIT_PACKAGE") or package.checkPerm(current_user, "APPROVE_NEW") %}
<a class="float-right" href="{{ package.getURL("packages.audit") }}"> <a class="float-right" href="{{ package.getURL("packages.audit") }}">
See audit log {{ _("See audit log") }}
</a> </a>
{% endif %} {% endif %}
</p> </p>

View File

@ -1,17 +1,19 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block title %} {% block title %}
Working {% if "error" in info or info.status == "FAILURE" or info.status == "REVOKED" %}
{{ _("Task Failed") }}
{% else %}
{{ _("Working…") }}
{% endif %}
{% endblock %} {% endblock %}
{% block content %} {% block content %}
{% if "error" in info or info.status == "FAILURE" or info.status == "REVOKED" %} <h1>{{ self.title() }}</h1>
<h1>Task Failed</h1>
{% if "error" in info or info.status == "FAILURE" or info.status == "REVOKED" %}
<pre>{{ info.error }}</pre> <pre>{{ info.error }}</pre>
{% else %} {% else %}
<h1>Working…</h1>
<script src="/static/polltask.js"></script> <script src="/static/polltask.js"></script>
<script> <script>
// @author rubenwardy // @author rubenwardy
@ -21,7 +23,7 @@ Working
.catch(function() { location.reload() }) .catch(function() { location.reload() })
</script> </script>
<noscript> <noscript>
Reload the page to check for updates. {{ _("Reload the page to check for updates.") }}
</noscript> </noscript>
{% endif %} {% endif %}
{% endblock %} {% endblock %}

View File

@ -1,22 +1,22 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block title %} {% block title %}
Delete reply in {{ thread.title }} {{ _("Delete reply by %{username)s in %(title)s ", title=thread.title, username=reply.author.username) }}
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<form method="POST" action="" class="card box_grey"> <form method="POST" action="" class="card box_grey">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" /> <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
<h3 class="card-header">Delete reply by {{ reply.author.username }}</h3> <h3 class="card-header">{{ self.title() }}</h3>
<div class="card-body markdown"> <div class="card-body markdown">
{{ reply.comment | markdown }} {{ reply.comment | markdown }}
</div> </div>
<div class="card-body"> <div class="card-body">
<p>Deleting is permanent</p> <p>{{ _("Deleting is permanent") }}</p>
<a class="btn btn-secondary mr-3" href="{{ thread.getViewURL() }}">Cancel</a> <a class="btn btn-secondary mr-3" href="{{ thread.getViewURL() }}">{{ _("Cancel") }}</a>
<input type="submit" value="Delete" class="btn btn-danger" /> <input type="submit" value="{{ _('Delete') }}" class="btn btn-danger" />
</div> </div>
</form> </form>
{% endblock %} {% endblock %}

View File

@ -13,10 +13,10 @@
{{ thread.replies[0].comment | markdown }} {{ thread.replies[0].comment | markdown }}
</div> </div>
<div class="card-body"> <div class="card-body">
<p>Deleting is permanent</p> <p>{{ _("Deleting is permanent") }}</p>
<a class="btn btn-secondary mr-3" href="{{ thread.getViewURL() }}">Cancel</a> <a class="btn btn-secondary mr-3" href="{{ thread.getViewURL() }}">{{ _("Cancel") }}</a>
<input type="submit" value="Delete" class="btn btn-danger" /> <input type="submit" value="{{ _('Delete') }}" class="btn btn-danger" />
</div> </div>
</form> </form>
{% endblock %} {% endblock %}

View File

@ -1,11 +1,11 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block title %} {% block title %}
Threads {{ _("Threads") }}
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<h1>Threads</h1> <h1>{{ self.title() }}</h1>
{% from "macros/pagination.html" import render_pagination %} {% from "macros/pagination.html" import render_pagination %}
{% from "macros/threads.html" import render_threadlist %} {% from "macros/threads.html" import render_threadlist %}

View File

@ -1,15 +1,15 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block title %} {% block title %}
New Thread {{ _("New Thread") }}
{% endblock %} {% endblock %}
{% block content %} {% block content %}
{% if package and current_user != package.author and package.issueTracker %} {% if package and current_user != package.author and package.issueTracker %}
<p class="alert alert-secondary"> <p class="alert alert-secondary">
Found a bug? Post on the <a href="{{ package.issueTracker }}">issue tracker</a> instead.<br /> {{ _("Found a bug? Post on the <a href='%(url)s'>issue tracker</a> instead.", url=package.issueTracker) }}<br />
If the package shouldn't be on CDB (eg: if it doesn't work at all), then you can let us know here. {{ _("If the package shouldn't be on CDB (eg: if it doesn't work at all), then you can let us know here.") }}
</p> </p>
{% endif %} {% endif %}
@ -37,8 +37,7 @@
{{ render_checkbox_field(form.private, class_="my-3") }} {{ render_checkbox_field(form.private, class_="my-3") }}
<p> <p>
Only you, the package author, and users of Approver rank {{ _("Only you, the package author, and users of Approver rank and above can read private threads.") }}
and above can read private threads.
</p> </p>
{{ render_submit_field(form.submit) }} {{ render_submit_field(form.submit) }}

View File

@ -43,7 +43,7 @@
{% else %} {% else %}
<i class="fas fa-reply mr-2"></i> <i class="fas fa-reply mr-2"></i>
<a class="badge badge-dark" href="{{ r.thread.getViewURL() }}"> <a class="badge badge-dark" href="{{ r.thread.getViewURL() }}">
Reply to <b>{{ r.thread.title }}</b> {{ _("Reply to <b>%(title)s</b>", title=r.thread.title) }}
</a> </a>
{% endif %} {% endif %}

View File

@ -28,12 +28,12 @@
{% if current_user in thread.watchers %} {% if current_user in thread.watchers %}
<form method="post" action="{{ thread.getUnsubscribeURL() }}" class="float-right"> <form method="post" action="{{ thread.getUnsubscribeURL() }}" class="float-right">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" /> <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
<input type="submit" class="btn btn-primary" value="Unsubscribe" /> <input type="submit" class="btn btn-primary" value="{{ _('Unsubscribe') }}" />
</form> </form>
{% else %} {% else %}
<form method="post" action="{{ thread.getSubscribeURL() }}" class="float-right"> <form method="post" action="{{ thread.getSubscribeURL() }}" class="float-right">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" /> <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
<input type="submit" class="btn btn-primary" value="Subscribe" /> <input type="submit" class="btn btn-primary" value="{{ _('Subscribe') }}" />
</form> </form>
{% endif %} {% endif %}
{% if thread and thread.checkPerm(current_user, "DELETE_THREAD") %} {% if thread and thread.checkPerm(current_user, "DELETE_THREAD") %}
@ -75,14 +75,13 @@
{% if thread.package %} {% if thread.package %}
<p> <p>
Package: <a href="{{ thread.package.getURL("packages.view") }}">{{ thread.package.title }}</a> {{ _("Package") }}: <a href="{{ thread.package.getURL("packages.view") }}">{{ thread.package.title }}</a>
</p> </p>
{% endif %} {% endif %}
{% if thread.private %} {% if thread.private %}
<i> <i>
This thread is only visible to its creator, the package owner, and users of {{ _("This thread is only visible to its creator, the package owner, and users of Approver rank or above.") }}
Approver rank or above.
</i> </i>
{% endif %} {% endif %}

View File

@ -5,14 +5,14 @@
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<h2 class="mb-4">Approval Queue</h2> <h2 class="mb-4">{{ _("Approval Queue") }}</h2>
{% if canApproveScn and screenshots %} {% if canApproveScn and screenshots %}
<div class="card my-4"> <div class="card my-4">
<h3 class="card-header">Screenshots <h3 class="card-header">{{ _("Screenshots") }}
<form class="float-right" method="post" action="{{ url_for('todo.view_editor') }}"> <form class="float-right" method="post" action="{{ url_for('todo.view_editor') }}">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" /> <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
<input type="hidden" name="action" value="screenshots_approve_all" /> <input type="hidden" name="action" value="screenshots_approve_all" />
<input class="btn btn-sm btn-primary" type="submit" value="Approve All" /> <input class="btn btn-sm btn-primary" type="submit" value="{{ _('Approve All') }}" />
</form> </form>
</h3> </h3>
<ul class="card-body d-flex p-0 flex-row flex-wrap justify-content-start align-content-start p-4"> <ul class="card-body d-flex p-0 flex-row flex-wrap justify-content-start align-content-start p-4">
@ -30,7 +30,7 @@
</div> </div>
</a></li> </a></li>
{% else %} {% else %}
<li><i>No screenshots need reviewing.</i></li> <li><i>{{ _("No screenshots need reviewing.") }}</i></li>
{% endfor %} {% endfor %}
{% for i in range(4) %} {% for i in range(4) %}
<li class="packagetile flex-fill"></li> <li class="packagetile flex-fill"></li>
@ -43,7 +43,7 @@
{% if canApproveNew and (packages or wip_packages) %} {% if canApproveNew and (packages or wip_packages) %}
<div class="col-sm-6"> <div class="col-sm-6">
<div class="card"> <div class="card">
<h3 class="card-header">Packages</h3> <h3 class="card-header">{{ _("Packages") }}</h3>
<div class="list-group list-group-flush"> <div class="list-group list-group-flush">
{% for p in packages %} {% for p in packages %}
<a href="{{ p.getURL("packages.view") }}" class="list-group-item list-group-item-action"> <a href="{{ p.getURL("packages.view") }}" class="list-group-item list-group-item-action">
@ -62,7 +62,7 @@
{{ p.title }} by {{ p.author.display_name }} {{ p.title }} by {{ p.author.display_name }}
</a> </a>
{% else %} {% else %}
<li class="list-group-item"><i>No packages need reviewing.</i></li> <li class="list-group-item"><i>{{ _("No packages need reviewing.") }}</i></li>
{% endfor %} {% endfor %}
</div> </div>
</div> </div>
@ -72,21 +72,22 @@
{% if canApproveRel and releases %} {% if canApproveRel and releases %}
<div class="col-sm-6"> <div class="col-sm-6">
<div class="card"> <div class="card">
<h3 class="card-header">Releases</h3> <h3 class="card-header">{{ _("Releases") }}</h3>
<ul class="list-group list-group-flush" style="max-height: 500px; overflow: hidden auto;"> <ul class="list-group list-group-flush" style="max-height: 500px; overflow: hidden auto;">
{% for r in releases %} {% for r in releases %}
<li class="list-group-item"> <li class="list-group-item">
{% if r.task_id %} {% if r.task_id %}
<span class="mr-2 badge badge-warning">Importing</span> <span class="mr-2 badge badge-warning">{{ _("Importing") }}</span>
{% endif %} {% endif %}
<a href="{{ r.getEditURL() }}">{{ r.title }}</a> <a href="{{ r.getEditURL() }}">{{ r.title }}</a>
on on
<a href="{{ r.package.getURL("packages.view") }}"> <a href="{{ r.package.getURL("packages.view") }}">
{{ r.package.title }} by {{ r.package.author.display_name }} {{ _("%(title)s by %(display_name)s",
title=r.package.title, display_name=r.package.author.display_name) }}
</a> </a>
</li> </li>
{% else %} {% else %}
<li class="list-group-item"><i>No releases need reviewing.</i></li> <li class="list-group-item"><i>{{ _("No releases need reviewing.") }}</i></li>
{% endfor %} {% endfor %}
</ul> </ul>
</div> </div>
@ -96,14 +97,14 @@
{% if not (packages or screenshots or releases) %} {% if not (packages or screenshots or releases) %}
<p> <p>
<i>All done!</i> <i>{{ _("All done!") }}</i>
</p> </p>
{% endif %} {% endif %}
{% if license_needed %} {% if license_needed %}
<h2 class="mt-5">License Needed</h2> <h2 class="mt-5">{{ _("License Needed") }}</h2>
<div class="card"> <div class="card">
<h3 class="card-header">License Needed</h3> <h3 class="card-header">{{ _("License Needed") }}</h3>
<div class="list-group list-group-flush"> <div class="list-group list-group-flush">
{% for p in license_needed %} {% for p in license_needed %}
<a href="{{ p.getURL("packages.view") }}" class="list-group-item list-group-item-action"> <a href="{{ p.getURL("packages.view") }}" class="list-group-item list-group-item-action">
@ -123,10 +124,11 @@
{% endif %} {% endif %}
<h2 class="mt-5">Tag Packages</h2> <h2 class="mt-5">{{ _("Tag Packages") }}</h2>
<p> <p>
{{ total_to_tag }} / {{ total_packages }} packages don't have any tags. {{ _("%(total_to_tag)d / %(total_packages)d packages don't have any tags.",
total_to_tag=total_to_tag, total_packages=total_packages) }}
</p> </p>
<div class="progress my-4"> <div class="progress my-4">
@ -135,13 +137,14 @@
style="width: {{ perc }}%" aria-valuenow="{{ perc }}" aria-valuemin="0" aria-valuemax="100"></div> style="width: {{ perc }}%" aria-valuenow="{{ perc }}" aria-valuemin="0" aria-valuemax="100"></div>
</div> </div>
<a class="btn btn-primary" href="{{ url_for('todo.tags') }}">View Tags</a> <a class="btn btn-primary" href="{{ url_for('todo.tags') }}">{{ _("View Tags") }}</a>
{% if unfulfilled_meta_packages %} {% if unfulfilled_meta_packages %}
<h2 class="mt-5"> <h2 class="mt-5">
<span class="fas fa-exclamation-triangle pr-2" style="color: orange;"></span> <span class="fas fa-exclamation-triangle pr-2" style="color: orange;"></span>
{{ unfulfilled_meta_packages }} Unfulfilled Dependencies {{ unfulfilled_meta_packages }}
{{ _("Unfulfilled Dependencies") }}
</h2> </h2>
<p> <p>
@ -152,7 +155,7 @@
{% endif %} {% endif %}
<h2 class="mt-5">WIP</h2> <h2 class="mt-5">{{ _("WIP") }}</h2>
{% if canApproveNew and (packages or wip_packages) %} {% if canApproveNew and (packages or wip_packages) %}
<div class="card"> <div class="card">
@ -167,7 +170,7 @@
</span> </span>
{% if p.state == p.state.WIP %} {% if p.state == p.state.WIP %}
<span class="mr-2 badge badge-warning">WIP</span> <span class="mr-2 badge badge-warning">{{ _("WIP") }}</span>
{% else %} {% else %}
<span class="mr-2 badge badge-danger">{{ p.state.value }}</span> <span class="mr-2 badge badge-danger">{{ p.state.value }}</span>
{% endif %} {% endif %}
@ -175,7 +178,7 @@
{{ p.title }} by {{ p.author.display_name }} {{ p.title }} by {{ p.author.display_name }}
</a> </a>
{% else %} {% else %}
<li class="list-group-item"><i>No packages need reviewing.</i></li> <li class="list-group-item"><i>{{ _("No packages need reviewing.") }}</i></li>
{% endfor %} {% endfor %}
</div> </div>
</div> </div>

View File

@ -31,7 +31,7 @@
</div> </div>
<div class="col-sm"> <div class="col-sm">
State: {{ package.state.value }} {{ _("State") }}: {{ package.state.value }}
</div> </div>
</div> </div>
</a> </a>
@ -41,7 +41,9 @@
</div> </div>
<a class="btn btn-secondary float-right" href="/help/update_config/">Help</a> <a class="btn btn-secondary float-right" href="/help/update_config/">Help</a>
<a class="btn btn-secondary float-right mr-2" href="{{ url_for('packages.bulk_update_config', username=user.username) }}">See all Update Settings</a> <a class="btn btn-secondary float-right mr-2" href="{{ url_for('packages.bulk_update_config', username=user.username) }}">
{{ _("See all Update Settings") }}
</a>
{% if outdated_packages %} {% if outdated_packages %}
<form class="float-right mr-2" method="post" action="{{ url_for('todo.apply_all_updates', username=user.username) }}"> <form class="float-right mr-2" method="post" action="{{ url_for('todo.apply_all_updates', username=user.username) }}">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" /> <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
@ -67,7 +69,7 @@
<a class="btn btn-secondary float-right" href="{{ url_for('todo.tags', author=user.username) }}">See All</a> <a class="btn btn-secondary float-right" href="{{ url_for('todo.tags', author=user.username) }}">See All</a>
<h2>{{ _("Packages Without Tags") }}</h2> <h2>{{ _("Packages Without Tags") }}</h2>
<p> <p>
Labelling your packages with tags helps users find them. {{ _("Labelling your packages with tags helps users find them.") }}
</p> </p>
<div class="list-group mt-3 mb-5"> <div class="list-group mt-3 mb-5">
{% for package in needs_tags %} {% for package in needs_tags %}
@ -90,8 +92,8 @@
<h2 class="mt-5">{{ _("Unadded Topics") }}</h2> <h2 class="mt-5">{{ _("Unadded Topics") }}</h2>
{% if topics_to_add %} {% if topics_to_add %}
<p> <p>
List of your forum topics which do not have a matching package. {{ _("List of your forum topics which do not have a matching package.") }}
Topics with a strikethrough have been marked as discarded. {{ _("Topics with a strikethrough have been marked as discarded.") }}
</p> </p>
<div style="max-height: 20em; overflow-y: auto"> <div style="max-height: 20em; overflow-y: auto">
@ -99,7 +101,7 @@
{{ render_topics_table(topics_to_add, show_author=False, show_discard=True, current_user=current_user) }} {{ render_topics_table(topics_to_add, show_author=False, show_discard=True, current_user=current_user) }}
</div> </div>
{% else %} {% else %}
<p class="card-body">Congrats! You don't have any topics which aren't on CDB.</p> <p class="card-body">{{ _("Congrats! You don't have any topics which aren't on CDB.") }}</p>
{% endif %} {% endif %}
{% endblock %} {% endblock %}

View File

@ -1,7 +1,11 @@
{% extends "users/settings_base.html" %} {% extends "users/settings_base.html" %}
{% block title %} {% block title %}
{{ _("Account and Security | %(username)s", username=user.username) }} {{ _("Account and Security - %(username)s", username=user.username) }}
{% endblock %}
{% block ruben_link %}
<a href="https://forum.minetest.net/ucp.php?i=pm&mode=compose&u=2051">rubenwardy</a>
{% endblock %} {% endblock %}
{% block pane %} {% block pane %}
@ -37,9 +41,13 @@
<h3>{{ _("Password") }}</h3> <h3>{{ _("Password") }}</h3>
{% if user == current_user %} {% if user == current_user %}
{% if user.password %} {% if user.password %}
<a class="btn btn-primary" href="{{ url_for('users.change_password') }}">Change Password</a> <a class="btn btn-primary" href="{{ url_for('users.change_password') }}">
{{ _("Change Password") }}
</a>
{% else %} {% else %}
<a class="btn btn-primary" href="{{ url_for('users.set_password') }}">Set Password</a> <a class="btn btn-primary" href="{{ url_for('users.set_password') }}">
{{ _("Set Password") }}
</a>
{% endif %} {% endif %}
{% else %} {% else %}
{% if user.password %} {% if user.password %}
@ -56,11 +64,10 @@
<td> <td>
{% if user.forums_username %} {% if user.forums_username %}
<a class="btn btn-secondary" href="https://forum.minetest.net/memberlist.php?mode=viewprofile&un={{ user.forums_username }}"> <a class="btn btn-secondary" href="https://forum.minetest.net/memberlist.php?mode=viewprofile&un={{ user.forums_username }}">
Connected [{{ user.forums_username }}] {{ _("Connected") }} [{{ user.forums_username }}]
</a> </a>
{% else %} {% else %}
Please <a href="https://forum.minetest.net/ucp.php?i=pm&mode=compose&u=2051">PM rubenwardy</a> {{ _("Please PM %(rubenwardy)s on the forums to link your account.", rubenwardy=self.ruben_link()) }}
on the forums to link your account.
{% endif %} {% endif %}
</td> </td>
</tr> </tr>
@ -69,23 +76,29 @@
<td> <td>
{% if user.github_username %} {% if user.github_username %}
<a class="btn btn-secondary" href="https://github.com/{{ user.github_username }}"> <a class="btn btn-secondary" href="https://github.com/{{ user.github_username }}">
Connected [{{ user.github_username }}] {{ _("Connected") }} [{{ user.github_username }}]
</a> </a>
{% if user == current_user %} {% if user == current_user %}
<a class="btn btn-secondary ml-2" href="{{ url_for('github.view_permissions') }}">View ContentDB's GitHub Permissions</a> <a class="btn btn-secondary ml-2" href="{{ url_for('github.view_permissions') }}">
{{ _("View ContentDB's GitHub Permissions") }}
</a>
{% endif %} {% endif %}
{% elif user == current_user %} {% elif user == current_user %}
<a class="btn btn-secondary" href="{{ url_for('github.start') }}">Link Github</a> <a class="btn btn-secondary" href="{{ url_for('github.start') }}">
{{ _("Link Github") }}
</a>
{% else %} {% else %}
None {{ _("None") }}
{% endif %} {% endif %}
</td> </td>
</tr> </tr>
</table> </table>
{% if current_user.rank.atLeast(current_user.rank.MODERATOR) %} {% if current_user.rank.atLeast(current_user.rank.MODERATOR) %}
<a class="btn btn-secondary float-right" href="{{ url_for('admin.audit', username=user.username) }}">View All</a> <a class="btn btn-secondary float-right" href="{{ url_for('admin.audit', username=user.username) }}">
{{ _("View All") }}
</a>
{% endif %} {% endif %}
<h3>{{ _("Recent Account Actions") }}</h3> <h3>{{ _("Recent Account Actions") }}</h3>
@ -96,7 +109,8 @@
<h3>{{ _("Account Deletion and Deactivation") }}</h3> <h3>{{ _("Account Deletion and Deactivation") }}</h3>
{% if current_user.rank.atLeast(current_user.rank.ADMIN) %} {% if current_user.rank.atLeast(current_user.rank.ADMIN) %}
<a class="btn btn-danger" href="{{ url_for('users.delete', username=user.username) }}">Delete or Deactivate</a> <a class="btn btn-danger" href="{{ url_for('users.delete', username=user.username) }}">
{{ _("Delete or Deactivate") }}</a>
{% else %} {% else %}
<p> <p>
{{ _("Account Deletion and Deactivation isn't available to users yet.") }} {{ _("Account Deletion and Deactivation isn't available to users yet.") }}

View File

@ -8,14 +8,16 @@
{% if optional %} {% if optional %}
<div class="alert alert-primary"> <div class="alert alert-primary">
It is recommended that you set a password for your account. {{ _("It is recommended that you set a password for your account.") }}
<a class="alert_right button" href="{{ url_for('homepage.home') }}">Skip</a> <a class="alert_right button" href="{{ url_for('homepage.home') }}">
{{ _("Skip") }}
</a>
</div> </div>
{% endif %} {% endif %}
<h1>Set Password</h1> <h1>{{ _("Set Password") }}</h1>
{% from "macros/forms.html" import render_field, render_submit_field %} {% from "macros/forms.html" import render_field, render_submit_field %}
<form action="" method="POST" class="form" role="form"> <form action="" method="POST" class="form" role="form">
@ -31,15 +33,12 @@
{{ render_field(form.old_password, tabindex=230) }} {{ render_field(form.old_password, tabindex=230) }}
{% endif %} {% endif %}
{{ render_field(form.password, tabindex=230) }} {{ render_field(form.password, tabindex=230, hint=_("Must be at least 8 characters long.")) }}
{{ render_field(form.password2, tabindex=240) }} {{ render_field(form.password2, tabindex=240) }}
<p> <p>
Must be at least 8 characters long. {{ _("Password suggestion") }}
</p> (<a href="https://xkcd.com/936/">{{ _("Why?") }}</a>):
<p>
Password suggestion
(<a href="https://xkcd.com/936/">Why?</a>):
<code>{{ suggested_password }}</code> <code>{{ suggested_password }}</code>
</p> </p>

View File

@ -10,17 +10,22 @@
<h2>{{ _("Do you have an account on the Minetest Forums?") }}</h2> <h2>{{ _("Do you have an account on the Minetest Forums?") }}</h2>
<p> <p>
ContentDB will link your account to your forum account. {{ _("ContentDB will link your account to your forum account.") }}
</p> </p>
<p> <p>
You don't need a forum account, however, it's recommended to make the most {{ _("You don't need a forum account, however, it's recommended to make the most out of the Minetest community.") }}
out of the Minetest community.
</p> </p>
<p class="mt-5"> <p class="mt-5">
<a class="btn btn-primary mr-3" href="{{ url_for('users.claim_forums') }}"><b>Yes</b>, I have a forums account</a> <a class="btn btn-primary mr-3" href="{{ url_for('users.claim_forums') }}">
<a class="btn btn-primary mr-3" href="{{ url_for('users.register') }}"><b>No</b>, I don't have one</a> {{ _("<b>Yes</b>, I have a forums account") }}
<a class="btn btn-secondary" href="https://forum.minetest.net/ucp.php?mode=register">Create forum account</a> </a>
<a class="btn btn-primary mr-3" href="{{ url_for('users.register') }}">
{{ _("<b>No</b>, I don't have one") }}
</a>
<a class="btn btn-secondary" href="https://forum.minetest.net/ucp.php?mode=register">
{{ _("Create forum account") }}
</a>
</p> </p>
{% endblock %} {% endblock %}

View File

@ -10,21 +10,21 @@ Create Account from Forums User
<h2>{{ _("Confirm Your Account") }}</h2> <h2>{{ _("Confirm Your Account") }}</h2>
<p> <p>
You'll need to use prove that you have access to your forum account using one of the options below.<br> {{ _("You'll need to use prove that you have access to your forum account using one of the options below.") }}<br>
This is so ContentDB can link your account to your forum account. {{ _("This is so ContentDB can link your account to your forum account.") }}
</p> </p>
<p> <p>
Don't have a forums account? {{ _("Don't have a forums account?") }}
You can still <a href="{{ url_for('users.register') }}">sign up without one</a>. {{ _("You can still <a href='%(url)s'>sign up without one</a>.", link=url_for('users.register')) }}
</p> </p>
<div class="row mt-5"> <div class="row mt-5">
<div class="col-sm-6"> <div class="col-sm-6">
<div class="card"> <div class="card">
<div class="card-header"> <div class="card-header">
<span class="badge badge-pill badge-dark mr-2">Option 1</span> <span class="badge badge-pill badge-dark mr-2">{{ _("Option 1") }}</span>
Use GitHub field in forum profile {{ _("Use GitHub field in forum profile") }}
</div> </div>
<form method="post" class="card-body" action=""> <form method="post" class="card-body" action="">
@ -32,20 +32,19 @@ Create Account from Forums User
<input class="form-control" type="hidden" name="csrf_token" value="{{ csrf_token() }}" /> <input class="form-control" type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
<p> <p>
Enter your forum username here: {{ _("Enter your forum username here:") }}
</p> </p>
<input class="form-control my-4" type="text" name="username" value="{{ username }}" <input class="form-control my-4" type="text" name="username" value="{{ username }}"
placeholder="Forum username" pattern="[a-zA-Z0-9._ -]+" title="Only a-zA-Z0-9._ allowed" required> placeholder="{{ _('Forum username') }}" pattern="[a-zA-Z0-9._ -]+"
title="{{ _('Only a-zA-Z0-9._ allowed') }}" required>
<p> <p>
You'll need to have the GitHub field in your forum profile {{ _("You'll need to have the GitHub field in your forum profile filled out.") }}
filled out. Log into the forum and {{ _("Log into the forum and <a href='https://forum.minetest.net/ucp.php?i=173'>do that here</a>.") }}
<a href="https://forum.minetest.net/ucp.php?i=173">
do that here</a>.
</p> </p>
<input class="btn btn-primary" type="submit" value="Next: log in with GitHub"> <input class="btn btn-primary" type="submit" value="{{ _('Next: log in with GitHub') }}">
</form> </form>
</div> </div>
</div> </div>
@ -53,8 +52,8 @@ Create Account from Forums User
<div class="col-sm-6"> <div class="col-sm-6">
<div class="card"> <div class="card">
<div class="card-header"> <div class="card-header">
<span class="badge badge-pill badge-dark mr-2">Option 2</span> <span class="badge badge-pill badge-dark mr-2">{{ _("Option 2") }}</span>
Verification token {{ _("Verification token") }}
</div> </div>
<form method="post" class="card-body" action=""> <form method="post" class="card-body" action="">
@ -62,33 +61,30 @@ Create Account from Forums User
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" /> <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
<p> <p>
Enter your forum username here: {{ _("Enter your forum username here:") }}
</p> </p>
<input class="form-control my-3" type="text" name="username" value="{{ username }}" <input class="form-control my-3" type="text" name="username" value="{{ username }}"
placeholder="Forum username" pattern="[a-zA-Z0-9._ -]+" title="Only a-zA-Z0-9._ allowed" required> placeholder="{{ _('Forum username') }}" pattern="[a-zA-Z0-9._ -]+" title="{{ _('Only a-zA-Z0-9._ allowed') }}" required>
<p> <p>
Go to {{ _("Go to <a href="https://forum.minetest.net/ucp.php?i=profile&mode=signature">User Control Panel > Profile > Edit signature</a>") }}
<a href="https://forum.minetest.net/ucp.php?i=profile&mode=signature">
User Control Panel > Profile > Edit signature
</a>
</p> </p>
<p> <p>
Paste this into your signature: {{ _("Paste this into your signature:") }}
</p> </p>
<input class="form-control my-3" type="text" value="{{ key }}" readonly size=32> <input class="form-control my-3" type="text" value="{{ key }}" readonly size=32>
<p> <p>
Click next so we can check it. {{ _("Click next so we can check it.") }}
</p> </p>
<p> <p>
Don't worry, you can remove it after this is done. {{ _("Don't worry, you can remove it after this is done.") }}
</p> </p>
<input class="btn btn-primary" type="submit" value="Next"> <input class="btn btn-primary" type="submit" value="{{ _('Next') }}">
</form> </form>
</div> </div>
</div> </div>

View File

@ -1,7 +1,7 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block title %} {% block title %}
Delete user {{ user.username }} {{ _("Delete user %(username)s", username=user.username) }}
{% endblock %} {% endblock %}
{% block content %} {% block content %}
@ -10,7 +10,7 @@
<h3 class="card-header">{{ self.title() }}</h3> <h3 class="card-header">{{ self.title() }}</h3>
<div class="card-body"> <div class="card-body">
<p><b>Deleting is permanent</b></p> <p><b>{{ _("Deleting is permanent") }}</b></p>
{% if can_delete %} {% if can_delete %}
<p> <p>
@ -26,16 +26,18 @@
</p> </p>
{% endif %} {% endif %}
<a class="btn btn-secondary mr-3" href="{{ url_for('users.account', username=user.username) }}">Cancel</a> <a class="btn btn-secondary mr-3" href="{{ url_for('users.account', username=user.username) }}">
{{ _("Cancel") }}
</a>
<input type="submit" <input type="submit"
{% if can_delete %} {% if can_delete %}
name="delete" value="Delete" name="delete" value="{{ _('Delete') }}"
{% else %} {% else %}
name="deactivate" value="Deactivate" name="deactivate" value="{{ _('Deactivate') }}"
{% endif %} {% endif %}
class="btn btn-danger" /> class="btn btn-danger" />
{% if not can_delete and current_user.rank.atLeast(current_user.rank.ADMIN) %} {% if not can_delete and current_user.rank.atLeast(current_user.rank.ADMIN) %}
<input type="submit" name="delete" value="Delete Anyway" class="btn btn-danger ml-3" /> <input type="submit" name="delete" value="{{ _('Delete Anyway') }}" class="btn btn-danger ml-3" />
{% endif %} {% endif %}
</div> </div>
</form> </form>

View File

@ -1,14 +1,14 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block title %} {% block title %}
Request Password Reset {{ _("Request Password Reset") }}
{% endblock %} {% endblock %}
{% block content %} {% block content %}
{% from "macros/forms.html" import render_field, render_checkbox_field, render_submit_field %} {% from "macros/forms.html" import render_field, render_checkbox_field, render_submit_field %}
<div class="card"> <div class="card">
<h2 class="card-header">{{ _("Request Password Reset") }}</h2> <h2 class="card-header">{{ self.title() }}</h2>
<form action="" method="POST" class="form card-body" role="form"> <form action="" method="POST" class="form card-body" role="form">
{{ form.hidden_tag() }} {{ form.hidden_tag() }}

View File

@ -15,7 +15,9 @@
</p> </p>
{% if not current_user.is_authenticated %} {% if not current_user.is_authenticated %}
<a class="btn btn-primary" href="{{ url_for('users.claim_forums', username=username) }}">Claim Account</a> <a class="btn btn-primary" href="{{ url_for('users.claim_forums', username=username) }}">
{{ _("Claim Account") }}
</a>
{% endif %} {% endif %}
</article> </article>
{% endblock %} {% endblock %}

View File

@ -1,7 +1,7 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block title %} {% block title %}
Sign in {{ _("Sign in") }}
{% endblock %} {% endblock %}
{% block container %} {% block container %}
@ -10,7 +10,7 @@
<form class="signin" method="POST"> <form class="signin" method="POST">
{{ form.hidden_tag() }} {{ form.hidden_tag() }}
<h1 class="h3 mb-4 font-weight-normal">Sign in</h1> <h1 class="h3 mb-4 font-weight-normal">{{ self.title() }}</h1>
{{ render_field(form.username, tabindex=110, label_visible=False, placeholder=_("Username or email")) }} {{ render_field(form.username, tabindex=110, label_visible=False, placeholder=_("Username or email")) }}
{{ render_field(form.password, tabindex=120, label_visible=False, placeholder=_("Password")) }} {{ render_field(form.password, tabindex=120, label_visible=False, placeholder=_("Password")) }}

View File

@ -8,7 +8,7 @@
<article class="row mb-5"> <article class="row mb-5">
<div class="col-auto image mx-0"> <div class="col-auto image mx-0">
<img class="img-fluid user-photo img-thumbnail img-thumbnail-1" src="{{ user.getProfilePicURL() }}" alt="Profile picture"> <img class="img-fluid user-photo img-thumbnail img-thumbnail-1" src="{{ user.getProfilePicURL() }}" alt="{{ _('Profile picture') }}">
</div> </div>
<div class="col"> <div class="col">
{% if user.can_see_edit_profile(current_user) %} {% if user.can_see_edit_profile(current_user) %}
@ -117,9 +117,9 @@
{% if not current_user.is_authenticated and user.rank == user.rank.NOT_JOINED and user.forums_username %} {% if not current_user.is_authenticated and user.rank == user.rank.NOT_JOINED and user.forums_username %}
<div class="alert alert-secondary mb-5"> <div class="alert alert-secondary mb-5">
<a class="float-right btn btn-default btn-sm" <a class="float-right btn btn-default btn-sm"
href="{{ url_for('users.claim_forums', username=user.forums_username) }}">Claim</a> href="{{ url_for('users.claim_forums', username=user.forums_username) }}">{{ _("Claim") }}</a>
Is this you? Claim your account now! {{ _("Is this you? Claim your account now!") }}
</div> </div>
{% else %} {% else %}
<div class="row mb-5"> <div class="row mb-5">
@ -166,13 +166,13 @@
<a class="float-right btn btn-sm btn-primary" <a class="float-right btn btn-sm btn-primary"
href="{{ url_for('packages.create_edit', author=user.username) }}"> href="{{ url_for('packages.create_edit', author=user.username) }}">
<i class="fas fa-plus mr-1"></i> <i class="fas fa-plus mr-1"></i>
Create package {{ _("Create package") }}
</a> </a>
{% endif %} {% endif %}
{% if current_user == user or (current_user.is_authenticated and current_user.rank.atLeast(current_user.rank.EDITOR)) %} {% if current_user == user or (current_user.is_authenticated and current_user.rank.atLeast(current_user.rank.EDITOR)) %}
<a class="float-right btn btn-sm btn-secondary mr-2" <a class="float-right btn btn-sm btn-secondary mr-2"
href="{{ url_for('todo.tags', author=user.username) }}"> href="{{ url_for('todo.tags', author=user.username) }}">
View list of tags {{ _("View list of tags") }}
</a> </a>
{% endif %} {% endif %}
<h2 class="my-3">{{ _("Packages") }}</h2> <h2 class="my-3">{{ _("Packages") }}</h2>

View File

@ -1,7 +1,7 @@
{% extends "users/settings_base.html" %} {% extends "users/settings_base.html" %}
{% block title %} {% block title %}
{{ _("Edit Profile | %(username)s", username=user.username) }} {{ _("Edit Profile - %(username)s", username=user.username) }}
{% endblock %} {% endblock %}
{% block pane %} {% block pane %}

View File

@ -1,14 +1,14 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block title %} {% block title %}
Register {{ _("Register") }}
{% endblock %} {% endblock %}
{% block content %} {% block content %}
{% from "macros/forms.html" import render_field, render_checkbox_field, render_submit_field %} {% from "macros/forms.html" import render_field, render_checkbox_field, render_submit_field %}
<div class="card w-50 text-left" style="margin: 2em auto;"> <div class="card w-50 text-left" style="margin: 2em auto;">
<h2 class="card-header">{{ _("Register") }}</h2> <h2 class="card-header">{{ self.title() }}</h2>
<form action="" method="POST" class="form card-body" role="form"> <form action="" method="POST" class="form card-body" role="form">
{{ form.hidden_tag() }} {{ form.hidden_tag() }}
@ -27,8 +27,8 @@ Register
{{ render_field(form.password, hint=_("Must be at least 8 characters long.")) }} {{ render_field(form.password, hint=_("Must be at least 8 characters long.")) }}
<p> <p>
Password suggestion {{ _("Password suggestion") }}
(<a href="https://xkcd.com/936/">Why?</a>): (<a href="https://xkcd.com/936/">{{ _("Why?") }}</a>):
<code>{{ suggested_password }}</code> <code>{{ suggested_password }}</code>
</p> </p>

View File

@ -1,7 +1,7 @@
{% extends "users/settings_base.html" %} {% extends "users/settings_base.html" %}
{% block title %} {% block title %}
{{ _("Email and Notifications | %(username)s", username=user.username) }} {{ _("Email and Notifications - %(username)s", username=user.username) }}
{% endblock %} {% endblock %}
{% block pane %} {% block pane %}
@ -11,7 +11,7 @@
<form action="" method="POST" class="form" role="form"> <form action="" method="POST" class="form" role="form">
{{ form.hidden_tag() }} {{ form.hidden_tag() }}
<h3>Email Address</h3> <h3>{{ _("Email Address") }}</h3>
{{ render_field(form.email, tabindex=100) }} {{ render_field(form.email, tabindex=100) }}
@ -26,7 +26,7 @@
</p> </p>
{% endif %} {% endif %}
<h3>Notification Settings</h3> <h3>{{ _("Notification Settings") }}</h3>
{% if is_new %} {% if is_new %}
<p class="alert alert-info"> <p class="alert alert-info">
@ -35,15 +35,15 @@
{% endif %} {% endif %}
<p> <p>
Configure whether certain types of notifications are sent immediately, or as part of a daily digest. <br> {{ _("Configure whether certain types of notifications are sent immediately, or as part of a daily digest.") }}
</p> </p>
<table class="table"> <table class="table">
<tr> <tr>
<th>Event</th> <th>{{ _("Event") }}</th>
<th>Description</th> <th>{{ _("Description") }}</th>
<td>Immediately</td> <td>{{ _("Immediately") }}</td>
<td>In digest</td> <td>{{ _("In digest") }}</td>
</tr> </tr>
{% for type in types %} {% for type in types %}
<tr> <tr>

View File

@ -36,28 +36,29 @@
{% if user %} {% if user %}
<div class="alert alert-danger"> <div class="alert alert-danger">
<p> <p>
<strong>Unsubscribing may prevent you from being able to sign into the <strong>
account '{{ user.display_name }}'</strong>. {{ _("Unsubscribing may prevent you from being able to sign into the account '%(display_name)s'", display_name=user.display_name) }}
</strong>.
</p> </p>
<p class="mb-0"> <p class="mb-0">
ContentDB will no longer be able to send "forget password" and other essential system emails. {{ _("ContentDB will no longer be able to send "forget password" and other essential system emails.
Consider editing your email notification preferences instead. Consider editing your email notification preferences instead.") }}
</p> </p>
</div> </div>
{% else %} {% else %}
<p class="alert alert-warning"> <p class="alert alert-warning">
You won't be able to use this email with ContentDB anymore. {{ _("You won't be able to use this email with ContentDB anymore.") }}
</p> </p>
{% endif %} {% endif %}
<div class="button-group mt-4"> <div class="button-group mt-4">
{% if user %} {% if user %}
<a class="btn btn-primary mr-3" href="{{ url_for('users.email_notifications', username=user.username) }}"> <a class="btn btn-primary mr-3" href="{{ url_for('users.email_notifications', username=user.username) }}">
Edit Notification Preferences {{ _("Edit Notification Preferences") }}
</a> </a>
{% endif %} {% endif %}
<input class="btn btn-danger" type="submit" value="Unsubscribe"> <input class="btn btn-danger" type="submit" value="{{ _('Unsubscribe') }}">
</div> </div>
</form> </form>
{% endif %} {% endif %}