Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Update translate tag #543

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ af2c352786f952d819e69b928bf6c99dcde5954b
5821434b42203b1080dcdc480d1ffcf07fe53a90
# Format with Ruff
e72aba6d7e5891ac777f533eef6f7520410c9e0b
# Update translate tag.
8c4d552eedba195286c6fbadc2fae3b989cc15f7
2 changes: 1 addition & 1 deletion promgen/templates/promgen/alert_row.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@
</dl>
</td>
<td>
<a @click="setSilenceLabels(alert.labels)" class="btn btn-warning btn-xs">{% trans "Silence" %}</a>
<a @click="setSilenceLabels(alert.labels)" class="btn btn-warning btn-xs">{% translate "Silence" %}</a>
</td>
4 changes: 2 additions & 2 deletions promgen/templates/promgen/exporter_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ <h1>Project: {{ project.name }}</h1>
<div class="input-group-btn">
<button class="btn btn-primary">Register Exporter</button>
<exporter-test class="btn btn-info" href="{% url 'exporter-scrape' project.id %}">
{% trans "Test" %}
{% translate "Test" %}
</exporter-test>
</div>
</div>
Expand All @@ -61,7 +61,7 @@ <h1>Project: {{ project.name }}</h1>
<div class="input-group-btn">
<button style="width:80%" class="btn btn-primary" v-pre>Register {{ default.job }} :{{ default.port }}{{ default.path }}</button>
<exporter-test class="btn btn-info" href="{% url 'exporter-scrape' project.id %}">
{% trans "Test" %}
{% translate "Test" %}
</exporter-test>
</div>
</form>
Expand Down
2 changes: 1 addition & 1 deletion promgen/templates/promgen/farm_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ <h1>Farm: {{ farm.name }} ({{ farm.source }})</h1>

<div class="panel-footer">
{% if farm.editable %}
<a href="{% url 'hosts-add' farm.id %}" class="btn btn-primary">{% trans "Register Hosts" %}</a>
<a href="{% url 'hosts-add' farm.id %}" class="btn btn-primary">{% translate "Register Hosts" %}</a>
{% endif %}
<form method="post" action="{% url 'farm-delete' farm.id %}" onsubmit="return confirm('Delete this farm?')" style="display: inline">
{% csrf_token %}
Expand Down
4 changes: 2 additions & 2 deletions promgen/templates/promgen/farm_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ <h1>Farms</h1>
{% if farm.driver.remote %}
<form method="post" action="{% url 'farm-convert' farm.id %}" onsubmit="return confirm('Convert this farm to local?')" style="display: inline">
{% csrf_token %}
<button class="btn btn-warning">{% trans "Convert to Local Farm" %}</button>
<button class="btn btn-warning">{% translate "Convert to Local Farm" %}</button>
</form>
{% endif %}
<form method="post" action="{% url 'farm-delete' farm.id %}" onsubmit="return confirm('Delete this farm?')" style="display: inline">
{% csrf_token %}
<button class="btn btn-danger">{% trans "Delete" %}</button>
<button class="btn btn-danger">{% translate "Delete" %}</button>
</form>
</td>
</tr>
Expand Down
2 changes: 1 addition & 1 deletion promgen/templates/promgen/host_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ <h1>Host: {{ slug }}</h1>
class="btn btn-warning"
data-instance="{{slug}}:[0-9]*"
style="display: inline-block;"
>{% trans "Silence" %}</a>
>{% translate "Silence" %}</a>
</div>
</div>

Expand Down
2 changes: 1 addition & 1 deletion promgen/templates/promgen/host_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ <h1>Farm: {{ farm.name }}</h1>
<table>
{{ form.as_table }}
</table>
<input type="submit" value="{% trans 'Register Hosts' %}" />
<input type="submit" value="{% translate 'Register Hosts' %}" />
</form>

{% endblock %}
8 changes: 4 additions & 4 deletions promgen/templates/promgen/profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@ <h1>{{user.username}} ({{user.email}})</h1>
{% endfor %}
</td>
<td>
<a href="{% url 'notifier-edit' notifier.id %}" class="btn btn-warning btn-xs">{% trans "Edit" %}</a>
<a href="{% url 'notifier-edit' notifier.id %}" class="btn btn-warning btn-xs">{% translate "Edit" %}</a>
<form method="post" action="{% url 'notifier-test' notifier.id %}" style="display: inline">
{% csrf_token %}
<input name="next" type="hidden" value="{{ request.get_full_path }}" />
<button class="btn btn-info btn-xs">{% trans "Test" %}</button>
<button class="btn btn-info btn-xs">{% translate "Test" %}</button>
</form>
<form method="post" action="{% url 'notifier-delete' notifier.id %}" onsubmit="return confirm('{% trans "Delete notification?" %}')" style="display: inline">
<form method="post" action="{% url 'notifier-delete' notifier.id %}" onsubmit="return confirm('{% translate "Delete notification?" %}')" style="display: inline">
{% csrf_token %}
<input name="next" type="hidden" value="{{ request.get_full_path }}" />
<button class="btn btn-danger btn-xs">{% trans "Delete" %}</button>
<button class="btn btn-danger btn-xs">{% translate "Delete" %}</button>
</form>
</td>
</tr>
Expand Down
4 changes: 2 additions & 2 deletions promgen/templates/promgen/project_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<h1>
Project: {{ project.name }}
{% if project.owner %}
<small class="pull-right">{% trans 'Contact' %}: {{project.owner.username}}</small>
<small class="pull-right">{% translate 'Contact' %}: {{project.owner.username}}</small>
{% endif %}
</h1>
</div>
Expand All @@ -23,7 +23,7 @@ <h1>
<div class="alert alert-warning" role="alert">
<span class="glyphicon glyphicon-alert" aria-hidden="true"></span>
<span class="sr-only">Warning:</span>
{% trans 'No notifications configured for this project. Please configure some' %}
{% translate 'No notifications configured for this project. Please configure some' %}
</div>
{% endif %}

Expand Down
28 changes: 14 additions & 14 deletions promgen/templates/promgen/project_detail_configuration.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,47 +6,47 @@
<div class="panel-body">
<div class="btn-group btn-group-sm" role="group" aria-label="...">
<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
{% trans "Register" %} <span class="caret"></span>
{% translate "Register" %} <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li role="presentation"><a href="{% url 'project-exporter' project.id %}">{% trans "Register Exporter" %}</a></li>
<li role="presentation"><a href="{% url 'rule-new' 'project' project.id %}">{% trans "Register Rule" %}</a></li>
<li role="presentation"><a href="{% url 'project-notifier' project.id %}">{% trans "Register Notifier" %}</a></li>
<li role="presentation"><a href="{% url 'project-exporter' project.id %}">{% translate "Register Exporter" %}</a></li>
<li role="presentation"><a href="{% url 'rule-new' 'project' project.id %}">{% translate "Register Rule" %}</a></li>
<li role="presentation"><a href="{% url 'project-notifier' project.id %}">{% translate "Register Notifier" %}</a></li>
</ul>
</div>

<form action="{% url 'project-notifier' project.id %}" style="display:inline" method="post">{% csrf_token %}
<input type="hidden" name="sender" value="promgen.notification.user">
<input type="hidden" name="value" value="{{request.user.username}}" />
<button class="btn btn-primary btn-sm">{% trans "Subscribe to Notifications" %}</button>
<button class="btn btn-primary btn-sm">{% translate "Subscribe to Notifications" %}</button>
</form>

<div class="btn-group btn-group-sm" role="group" aria-label="...">
<button type="button" class="btn btn-info dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
{% trans "Change History" %} <span class="caret"></span>
{% translate "Change History" %} <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li role="presentation"><a href="{% urlqs 'audit-list' project=project.id %}">{% trans "Edit History" %}</a></li>
<li role="presentation"><a href="{% urlqs 'alert-list' project=project.name %}">{% trans "Alert History" %}</a></li>
<li role="presentation"><a href="{% urlqs 'audit-list' project=project.id %}">{% translate "Edit History" %}</a></li>
<li role="presentation"><a href="{% urlqs 'alert-list' project=project.name %}">{% translate "Alert History" %}</a></li>
</ul>
</div>

<a href="{% url 'project-update' project.id %}" class="btn btn-warning btn-sm">{% trans "Update Project" %}</a>
<a @click="setSilenceDataset" class="btn btn-warning btn-sm" data-project="{{project.name}}" data-service="{{project.service.name}}">{% trans "Silence" %}</a>
<a href="{% url 'project-update' project.id %}" class="btn btn-warning btn-sm">{% translate "Update Project" %}</a>
<a @click="setSilenceDataset" class="btn btn-warning btn-sm" data-project="{{project.name}}" data-service="{{project.service.name}}">{% translate "Silence" %}</a>

<div class="btn-group btn-group-sm" role="group" aria-label="...">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Export <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li role="presentation"><a href="{% url 'api:project-rules' name=project.name %}">{% trans "Export Rules" %}</a></li>
<li role="presentation"><a href="{% url 'api:project-targets' name=project.name %}">{% trans "Export Project" %}</a></li>
<li role="presentation"><a href="{% url 'api:project-rules' name=project.name %}">{% translate "Export Rules" %}</a></li>
<li role="presentation"><a href="{% url 'api:project-targets' name=project.name %}">{% translate "Export Project" %}</a></li>
</ul>
</div>

<form method="post" action="{% url 'project-delete' project.id %}" onsubmit="return confirm('{% trans " Delete this Project?" %}')" style="display: inline">
<form method="post" action="{% url 'project-delete' project.id %}" onsubmit="return confirm('{% translate " Delete this Project?" %}')" style="display: inline">
{% csrf_token %}
<button class="btn btn-danger btn-sm pull-right">{% trans "Delete Project" %}</button>
<button class="btn btn-danger btn-sm pull-right">{% translate "Delete Project" %}</button>
</form>
</div>

Expand Down
10 changes: 5 additions & 5 deletions promgen/templates/promgen/project_detail_exporters.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<input type="hidden" name="port" value="{{ exporter.port }}" />
<input type="hidden" name="path" value="{{ exporter.path }}" />
<exporter-test class="btn btn-info btn-xs" href="{% url 'exporter-scrape' project.id %}">
{% trans "Test" %}
{% translate "Test" %}
</exporter-test>
</form>
</td>
Expand All @@ -44,19 +44,19 @@
data-project="{{project.name}}"
data-service="{{project.service.name}}"
style="display: inline-block;"
>{% trans "Silence" %}</a>
>{% translate "Silence" %}</a>
</td>
<td>
<form method="post" action="{% url 'exporter-delete' exporter.id %}" onsubmit="return confirm('{% trans 'Delete this exporter?' %}')" style="display: inline">
<form method="post" action="{% url 'exporter-delete' exporter.id %}" onsubmit="return confirm('{% translate 'Delete this exporter?' %}')" style="display: inline">
{% csrf_token %}
<button class="btn btn-danger btn-xs">{% trans "Delete" %}</button>
<button class="btn btn-danger btn-xs">{% translate "Delete" %}</button>
</form>
</td>
</tr>
{% endfor %}
</table>
<div class="panel-footer">
<a href="{% url 'project-exporter' project.id %}" class="btn btn-primary">{% trans "Register Exporter" %}</a>
<a href="{% url 'project-exporter' project.id %}" class="btn btn-primary">{% translate "Register Exporter" %}</a>
</div>
</div>

Expand Down
24 changes: 12 additions & 12 deletions promgen/templates/promgen/project_detail_hosts.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
data-project="{{project.name}}"
data-service="{{project.service.name}}"
style="display: inline-block;"
>{% trans "Silence" %}</a>
>{% translate "Silence" %}</a>
</td>
{% if project.farm.editable %}
<td>
<form method="post" action="{% url 'host-delete' host.id %}" onsubmit="return confirm('{% trans "Delete this host?" %}');">
<form method="post" action="{% url 'host-delete' host.id %}" onsubmit="return confirm('{% translate "Delete this host?" %}');">
{% csrf_token %}
<button name="delete" type="submit" class="btn btn-danger btn-xs">{% trans "Delete" %}</button>
<button name="delete" type="submit" class="btn btn-danger btn-xs">{% translate "Delete" %}</button>
</form>
</td>
{% endif %}
Expand All @@ -44,50 +44,50 @@
data-service="{{project.service.name}}"
style="display: inline-block;"
v-if="selectedHosts.length"
>{% trans "Silence selected hosts" %}</a>
>{% translate "Silence selected hosts" %}</a>
{% if project.farm %}
{% if project.farm.editable %}
<a href="{% url 'hosts-add' project.farm.id %}" class="btn btn-primary">
{% trans "Register Hosts" %}
{% translate "Register Hosts" %}
</a>
<a href="{% url 'farm-update' project.farm.id %}" class="btn btn-default">
{% trans "Edit Farm" %}
{% translate "Edit Farm" %}
</a>
{% else %}
<form method="post" action="{% url 'farm-convert' project.farm.id %}" onsubmit="return confirm('Convert this farm to local?')" style="display: inline">
{% csrf_token %}
<input name="next" type="hidden" value="{{ request.get_full_path }}" />
<button class="btn btn-warning">
<span class="glyphicon glyphicon-cloud-download" aria-hidden="true"></span>
{% trans "Convert to Local Farm" %}
{% translate "Convert to Local Farm" %}
</button>
</form>
<form method="post" action="{% url 'farm-refresh' project.farm.id %}" style="display: inline">
{% csrf_token %}
<input name="next" type="hidden" value="{{ request.get_full_path }}" />
<button type="submit" class="btn btn-warning">
<span class="glyphicon glyphicon-cloud-download" aria-hidden="true"></span>
{% trans "Sync Farm" %}
{% translate "Sync Farm" %}
</button>
</form>
{% endif %}
<form method="post" action="{% url 'farm-unlink' project.id %}" onsubmit="return confirm('{% trans "Unlink this farm?" %}')" style="display: inline">
<form method="post" action="{% url 'farm-unlink' project.id %}" onsubmit="return confirm('{% translate "Unlink this farm?" %}')" style="display: inline">
{% csrf_token %}
<button type="submit" class="btn btn-danger">
{% if source.remote %}
<span class="glyphicon glyphicon-cloud-download" aria-hidden="true"></span>
{% endif %}
{% trans "Unlink Farm" %}
{% translate "Unlink Farm" %}
</button>
</form>
{% else %}
<a href="{% url 'farm-new' project.id %}" class="btn btn-primary">{% trans "Register Farm" %}</a>
<a href="{% url 'farm-new' project.id %}" class="btn btn-primary">{% translate "Register Farm" %}</a>
{% for name, source in sources %}
<a href="{% url 'farm-link' project.id name %}" class="btn btn-default" v-pre>
{% if source.remote %}
<span class="glyphicon glyphicon-cloud-download" aria-hidden="true"></span>
{% endif %}
{% trans "Link Farm" %} {{ name }}
{% translate "Link Farm" %} {{ name }}
</a>
{% endfor %}
{% endif %}
Expand Down
4 changes: 2 additions & 2 deletions promgen/templates/promgen/project_detail_notifiers.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
<div class="panel-heading">Project Notifiers</div>
{% include "promgen/notifier_block.html" with object=project show_edit=1 %}
<div class="panel-footer" v-pre>
<a href="{% url 'project-notifier' project.id %}" class="btn btn-primary">{% trans "Register Notifier" %}</a>
<a href="{% url 'project-notifier' project.id %}" class="btn btn-primary">{% translate "Register Notifier" %}</a>
<form action="{% url 'project-notifier' project.id %}" style="display:inline" method="post">{% csrf_token %}
<input type="hidden" name="sender" value="promgen.notification.user">
<input type="hidden" name="value" value="{{request.user.username}}" />
<button class="btn btn-primary">{% trans "Subscribe to Notifications" %}</button>
<button class="btn btn-primary">{% translate "Subscribe to Notifications" %}</button>
</form>
</div>
</div>
4 changes: 2 additions & 2 deletions promgen/templates/promgen/project_detail_rules.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
</table>
<div class="panel-footer">
<a class="btn btn-default btn-xs" role="button" data-toggle="collapse" href=".project-service-rules-{{project.id}}" aria-expanded="false" aria-controls="collapseExample">
{% trans 'Show Service Rules' %}
{% translate 'Show Service Rules' %}
</a>
<a class="btn btn-default btn-xs" role="button" data-toggle="collapse" href=".project-site-rules-{{project.id}}" aria-expanded="false" aria-controls="collapseExample">
{% trans 'Show Site Rules' %}
{% translate 'Show Site Rules' %}
</a>
</div>
</div>
6 changes: 3 additions & 3 deletions promgen/templates/promgen/project_detail_urls.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
<a @click="setSilenceDataset"
class="btn btn-warning btn-xs"
data-job="{{url.probe.module}}"
data-instance="{{url.url}}">{% trans "Silence" %}</a>
data-instance="{{url.url}}">{% translate "Silence" %}</a>
</td>
<td>
<form method="post"
action="{% url 'url-delete' url.id %}"
onsubmit="return confirm('Delete this url?')"
style="display: inline">
{% csrf_token %}
<button class="btn btn-danger btn-xs">{% trans "Delete" %}</button>
<button class="btn btn-danger btn-xs">{% translate "Delete" %}</button>
</form>
</td>
</tr>
Expand All @@ -36,7 +36,7 @@
{{url_form.as_table}}
</table>
<div class="panel-footer">
<button class="btn btn-primary btn-sm">{% trans "Register URL" %}</button>
<button class="btn btn-primary btn-sm">{% translate "Register URL" %}</button>
</div>
</form>
</div>
6 changes: 3 additions & 3 deletions promgen/templates/promgen/project_row.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
{% empty %}
<tr>
<td colspan="3">
<a href="{% url 'project-exporter' project.id %}" class="btn btn-primary btn-xs">{% trans "Register Exporter" %}</a>
<a href="{% url 'project-exporter' project.id %}" class="btn btn-primary btn-xs">{% translate "Register Exporter" %}</a>
</td>
</tr>
{% endfor %}
Expand All @@ -30,14 +30,14 @@
{% empty %}
<tr>
<td colspan="2">
<a href="{% url 'project-notifier' project.id %}" class="btn btn-primary btn-xs">{% trans "Register Notifier" %}</a>
<a href="{% url 'project-notifier' project.id %}" class="btn btn-primary btn-xs">{% translate "Register Notifier" %}</a>
</td>
</tr>
{% endfor %}
</table>
</td>

<td>
<a @click="setSilenceDataset" class="btn btn-warning btn-xs" data-project="{{project.name}}" data-service="{{service.name}}">{% trans "Silence" %}</a>
<a @click="setSilenceDataset" class="btn btn-warning btn-xs" data-project="{{project.name}}" data-service="{{service.name}}">{% translate "Silence" %}</a>
</td>
</tr>
8 changes: 4 additions & 4 deletions promgen/templates/promgen/rule_block.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<td>
<a title="{{rule.description}}" data-toggle="tooltip" data-placement="right" href="{% url 'rule-detail' rule.id %}" v-pre>{{ rule.name }}</a>
{% if rule.parent %}
<a class="pull-right" title="{% trans "View Parent" %}" href="{% url 'rule-detail' rule.parent.id %}">
<a class="pull-right" title="{% translate "View Parent" %}" href="{% url 'rule-detail' rule.parent.id %}">
<span class="glyphicon glyphicon-upload"></span>
</a>
{% endif %}
Expand Down Expand Up @@ -34,14 +34,14 @@
<input name="content_type" type="hidden" value="{{overwrite_type}}" />
<input name="object_id" type="hidden" value="{{overwrite_id}}" />
{% csrf_token %}
<button class="btn btn-warning btn-xs">{% trans "Overwrite" %}</button>
<button class="btn btn-warning btn-xs">{% translate "Overwrite" %}</button>
</form>
</td>
{% else %}
<td>
<form method="post" action="{% url 'rule-delete' rule.id %}" onsubmit="return confirm('{% trans "Delete this Rule?" %}')" style="display: inline">
<form method="post" action="{% url 'rule-delete' rule.id %}" onsubmit="return confirm('{% translate "Delete this Rule?" %}')" style="display: inline">
{% csrf_token %}
<button class="btn btn-danger btn-xs">{% trans "Delete" %}</button>
<button class="btn btn-danger btn-xs">{% translate "Delete" %}</button>
</form>
</td>
{% endif %}
Expand Down
Loading