From 8c4d552eedba195286c6fbadc2fae3b989cc15f7 Mon Sep 17 00:00:00 2001 From: Paul Traylor Date: Mon, 9 Sep 2024 17:07:04 +0900 Subject: [PATCH 1/2] Update translate tag. Going forward, the translate tag is the recommended version so we update things for clarity. https://docs.djangoproject.com/en/3.2/topics/i18n/translation/#std:templatetag-translate > The trans tag was renamed to translate. The trans tag is still supported as an alias for backwards compatibility. --- promgen/templates/promgen/alert_row.html | 2 +- promgen/templates/promgen/exporter_form.html | 4 +-- promgen/templates/promgen/farm_detail.html | 2 +- promgen/templates/promgen/farm_list.html | 4 +-- promgen/templates/promgen/host_detail.html | 2 +- promgen/templates/promgen/host_form.html | 2 +- promgen/templates/promgen/profile.html | 8 ++--- promgen/templates/promgen/project_detail.html | 4 +-- .../promgen/project_detail_configuration.html | 28 ++++++++--------- .../promgen/project_detail_exporters.html | 10 +++---- .../promgen/project_detail_hosts.html | 24 +++++++-------- .../promgen/project_detail_notifiers.html | 4 +-- .../promgen/project_detail_rules.html | 4 +-- .../promgen/project_detail_urls.html | 6 ++-- promgen/templates/promgen/project_row.html | 6 ++-- promgen/templates/promgen/rule_block.html | 8 ++--- promgen/templates/promgen/rule_detail.html | 4 +-- promgen/templates/promgen/rule_list.html | 2 +- promgen/templates/promgen/rule_update.html | 8 ++--- promgen/templates/promgen/search.html | 4 +-- promgen/templates/promgen/sender_row.html | 8 ++--- promgen/templates/promgen/service_block.html | 30 +++++++++---------- .../promgen/service_block_projects.html | 4 +-- promgen/templates/promgen/service_detail.html | 2 +- promgen/templates/promgen/service_header.html | 2 +- promgen/templates/promgen/service_list.html | 4 +-- promgen/templates/promgen/shard_detail.html | 2 +- promgen/templates/promgen/shard_header.html | 2 +- promgen/templates/promgen/site_detail.html | 2 +- promgen/templates/promgen/url_list.html | 2 +- 30 files changed, 97 insertions(+), 97 deletions(-) diff --git a/promgen/templates/promgen/alert_row.html b/promgen/templates/promgen/alert_row.html index b3792d43d..cda9cda31 100644 --- a/promgen/templates/promgen/alert_row.html +++ b/promgen/templates/promgen/alert_row.html @@ -20,5 +20,5 @@ - {% trans "Silence" %} + {% translate "Silence" %} diff --git a/promgen/templates/promgen/exporter_form.html b/promgen/templates/promgen/exporter_form.html index c5deffef8..730ea181b 100644 --- a/promgen/templates/promgen/exporter_form.html +++ b/promgen/templates/promgen/exporter_form.html @@ -38,7 +38,7 @@

Project: {{ project.name }}

- {% trans "Test" %} + {% translate "Test" %}
@@ -61,7 +61,7 @@

Project: {{ project.name }}

- {% trans "Test" %} + {% translate "Test" %}
diff --git a/promgen/templates/promgen/farm_detail.html b/promgen/templates/promgen/farm_detail.html index 8e031433d..886880106 100644 --- a/promgen/templates/promgen/farm_detail.html +++ b/promgen/templates/promgen/farm_detail.html @@ -42,7 +42,7 @@

Farm: {{ farm.name }} ({{ farm.source }})

diff --git a/promgen/templates/promgen/host_form.html b/promgen/templates/promgen/host_form.html index 147cd98b0..989a8c53b 100644 --- a/promgen/templates/promgen/host_form.html +++ b/promgen/templates/promgen/host_form.html @@ -18,7 +18,7 @@

Farm: {{ farm.name }}

{{ form.as_table }}
- + {% endblock %} diff --git a/promgen/templates/promgen/profile.html b/promgen/templates/promgen/profile.html index a20657ab2..c899265c3 100644 --- a/promgen/templates/promgen/profile.html +++ b/promgen/templates/promgen/profile.html @@ -26,16 +26,16 @@

{{user.username}} ({{user.email}})

{% endfor %} - {% trans "Edit" %} + {% translate "Edit" %}
{% csrf_token %} - +
-
+ {% csrf_token %} - +
diff --git a/promgen/templates/promgen/project_detail.html b/promgen/templates/promgen/project_detail.html index 6842466bf..efa53f9e9 100644 --- a/promgen/templates/promgen/project_detail.html +++ b/promgen/templates/promgen/project_detail.html @@ -12,7 +12,7 @@

Project: {{ project.name }} {% if project.owner %} - {% trans 'Contact' %}: {{project.owner.username}} + {% translate 'Contact' %}: {{project.owner.username}} {% endif %}

@@ -23,7 +23,7 @@

{% endif %} diff --git a/promgen/templates/promgen/project_detail_configuration.html b/promgen/templates/promgen/project_detail_configuration.html index a5b8e80fc..951461ea7 100644 --- a/promgen/templates/promgen/project_detail_configuration.html +++ b/promgen/templates/promgen/project_detail_configuration.html @@ -6,47 +6,47 @@
{% csrf_token %} - +
- {% trans "Update Project" %} - {% trans "Silence" %} + {% translate "Update Project" %} + {% translate "Silence" %} -
+ {% csrf_token %} - +
diff --git a/promgen/templates/promgen/project_detail_exporters.html b/promgen/templates/promgen/project_detail_exporters.html index d73ec6b88..c658561ea 100644 --- a/promgen/templates/promgen/project_detail_exporters.html +++ b/promgen/templates/promgen/project_detail_exporters.html @@ -32,7 +32,7 @@ - {% trans "Test" %} + {% translate "Test" %} @@ -44,19 +44,19 @@ data-project="{{project.name}}" data-service="{{project.service.name}}" style="display: inline-block;" - >{% trans "Silence" %} + >{% translate "Silence" %} -
+ {% csrf_token %} - +
{% endfor %} diff --git a/promgen/templates/promgen/project_detail_hosts.html b/promgen/templates/promgen/project_detail_hosts.html index 305c818a3..43313b9f7 100644 --- a/promgen/templates/promgen/project_detail_hosts.html +++ b/promgen/templates/promgen/project_detail_hosts.html @@ -22,13 +22,13 @@ data-project="{{project.name}}" data-service="{{project.service.name}}" style="display: inline-block;" - >{% trans "Silence" %} + >{% translate "Silence" %} {% if project.farm.editable %} -
+ {% csrf_token %} - +
{% endif %} @@ -44,14 +44,14 @@ data-service="{{project.service.name}}" style="display: inline-block;" v-if="selectedHosts.length" - >{% trans "Silence selected hosts" %} + >{% translate "Silence selected hosts" %} {% if project.farm %} {% if project.farm.editable %} - {% trans "Register Hosts" %} + {% translate "Register Hosts" %} - {% trans "Edit Farm" %} + {% translate "Edit Farm" %} {% else %}
@@ -59,7 +59,7 @@
@@ -67,27 +67,27 @@
{% endif %} -
+ {% csrf_token %}
{% else %} - {% trans "Register Farm" %} + {% translate "Register Farm" %} {% for name, source in sources %} {% if source.remote %} {% endif %} - {% trans "Link Farm" %} {{ name }} + {% translate "Link Farm" %} {{ name }} {% endfor %} {% endif %} diff --git a/promgen/templates/promgen/project_detail_notifiers.html b/promgen/templates/promgen/project_detail_notifiers.html index ed3f7b84a..3036ddf4c 100644 --- a/promgen/templates/promgen/project_detail_notifiers.html +++ b/promgen/templates/promgen/project_detail_notifiers.html @@ -16,11 +16,11 @@
Project Notifiers
{% include "promgen/notifier_block.html" with object=project show_edit=1 %} diff --git a/promgen/templates/promgen/project_detail_rules.html b/promgen/templates/promgen/project_detail_rules.html index 5fc25b221..1c58c8edb 100644 --- a/promgen/templates/promgen/project_detail_rules.html +++ b/promgen/templates/promgen/project_detail_rules.html @@ -12,10 +12,10 @@ diff --git a/promgen/templates/promgen/project_detail_urls.html b/promgen/templates/promgen/project_detail_urls.html index 75365e460..e6f83e0fa 100644 --- a/promgen/templates/promgen/project_detail_urls.html +++ b/promgen/templates/promgen/project_detail_urls.html @@ -16,7 +16,7 @@ {% trans "Silence" %} + data-instance="{{url.url}}">{% translate "Silence" %}
{% csrf_token %} - +
@@ -36,7 +36,7 @@ {{url_form.as_table}} diff --git a/promgen/templates/promgen/project_row.html b/promgen/templates/promgen/project_row.html index 80d5eefe4..508b41f73 100644 --- a/promgen/templates/promgen/project_row.html +++ b/promgen/templates/promgen/project_row.html @@ -13,7 +13,7 @@ {% empty %} - {% trans "Register Exporter" %} + {% translate "Register Exporter" %} {% endfor %} @@ -30,7 +30,7 @@ {% empty %} - {% trans "Register Notifier" %} + {% translate "Register Notifier" %} {% endfor %} @@ -38,6 +38,6 @@ - {% trans "Silence" %} + {% translate "Silence" %} diff --git a/promgen/templates/promgen/rule_block.html b/promgen/templates/promgen/rule_block.html index c367d3e25..eca02e9fa 100644 --- a/promgen/templates/promgen/rule_block.html +++ b/promgen/templates/promgen/rule_block.html @@ -5,7 +5,7 @@ {{ rule.name }} {% if rule.parent %} - + {% endif %} @@ -34,14 +34,14 @@ {% csrf_token %} - + {% else %} -
+ {% csrf_token %} - +
{% endif %} diff --git a/promgen/templates/promgen/rule_detail.html b/promgen/templates/promgen/rule_detail.html index 1f48e270b..59150a709 100644 --- a/promgen/templates/promgen/rule_detail.html +++ b/promgen/templates/promgen/rule_detail.html @@ -37,8 +37,8 @@

Rule: {{ rule.name }}

{{rule|rule_dict|pretty_yaml}}
diff --git a/promgen/templates/promgen/rule_list.html b/promgen/templates/promgen/rule_list.html index 7aa0c1e6c..484d9084b 100644 --- a/promgen/templates/promgen/rule_list.html +++ b/promgen/templates/promgen/rule_list.html @@ -18,7 +18,7 @@

Rules

diff --git a/promgen/templates/promgen/rule_update.html b/promgen/templates/promgen/rule_update.html index 3e9f7f96c..1af1af799 100644 --- a/promgen/templates/promgen/rule_update.html +++ b/promgen/templates/promgen/rule_update.html @@ -92,17 +92,17 @@

Rule: {{ rule.name }}

-
+ {% csrf_token %} - +
diff --git a/promgen/templates/promgen/search.html b/promgen/templates/promgen/search.html index 2d86473ce..abca48413 100644 --- a/promgen/templates/promgen/search.html +++ b/promgen/templates/promgen/search.html @@ -89,7 +89,7 @@

Hosts

class="btn btn-warning btn-xs" data-instance="{{host.name}}:[0-9]*" style="display: inline-block;" - >{% trans "Silence" %} + >{% translate "Silence" %} {% endfor %} @@ -111,7 +111,7 @@

Hosts

class="btn btn-warning btn-xs" data-instance="{{host.name}}:[0-9]*" style="display: inline-block;" - >{% trans "Silence" %} + >{% translate "Silence" %} {% endfor %}
diff --git a/promgen/templates/promgen/sender_row.html b/promgen/templates/promgen/sender_row.html index f75ec4ae9..31b5dc8e0 100644 --- a/promgen/templates/promgen/sender_row.html +++ b/promgen/templates/promgen/sender_row.html @@ -36,15 +36,15 @@ data-csrfmiddlewaretoken="{{csrf_token}}" data-action="{% url 'notifier-toggle' notifier.id %}" /> - {% trans "Edit" %} + {% translate "Edit" %}
{% csrf_token %} - +
-
+ {% csrf_token %} - +
{% endif %} diff --git a/promgen/templates/promgen/service_block.html b/promgen/templates/promgen/service_block.html index 441752edd..c291265d5 100644 --- a/promgen/templates/promgen/service_block.html +++ b/promgen/templates/promgen/service_block.html @@ -37,47 +37,47 @@
{% csrf_token %} - +
- {% trans "Edit Service" %} - {% trans "Silence" %} + {% translate "Edit Service" %} + {% translate "Silence" %} -
+ {% csrf_token %} - +
@@ -91,7 +91,7 @@ diff --git a/promgen/templates/promgen/service_block_projects.html b/promgen/templates/promgen/service_block_projects.html index fd4540a03..2088b6693 100644 --- a/promgen/templates/promgen/service_block_projects.html +++ b/promgen/templates/promgen/service_block_projects.html @@ -8,7 +8,7 @@ Datasource {{shard.name}} ( {{shard.url}} ) - {% trans "Register Project" %} + {% translate "Register Project" %} @@ -23,7 +23,7 @@ {% endif %} diff --git a/promgen/templates/promgen/service_detail.html b/promgen/templates/promgen/service_detail.html index 556b8e1b6..8979cdb8b 100644 --- a/promgen/templates/promgen/service_detail.html +++ b/promgen/templates/promgen/service_detail.html @@ -11,7 +11,7 @@ diff --git a/promgen/templates/promgen/service_header.html b/promgen/templates/promgen/service_header.html index 1e3bdb2bc..c7f88048a 100644 --- a/promgen/templates/promgen/service_header.html +++ b/promgen/templates/promgen/service_header.html @@ -3,6 +3,6 @@

{{ service.name }} {% if service.owner %} - {% trans 'Contact' %}: {{service.owner.username}} + {% translate 'Contact' %}: {{service.owner.username}} {% endif %}

diff --git a/promgen/templates/promgen/service_list.html b/promgen/templates/promgen/service_list.html index 86d842d87..c57174d4e 100644 --- a/promgen/templates/promgen/service_list.html +++ b/promgen/templates/promgen/service_list.html @@ -5,8 +5,8 @@ {% block content %} {% breadcrumb label="Services" %} diff --git a/promgen/templates/promgen/shard_detail.html b/promgen/templates/promgen/shard_detail.html index 4932e5eab..41f855319 100644 --- a/promgen/templates/promgen/shard_detail.html +++ b/promgen/templates/promgen/shard_detail.html @@ -26,7 +26,7 @@

Datasource: {{ shard.name }}

{{ service.name }} {% if service.owner %} - {% trans 'Contact' %}: {{service.owner.username}} + {% translate 'Contact' %}: {{service.owner.username}} {% endif %}

diff --git a/promgen/templates/promgen/shard_header.html b/promgen/templates/promgen/shard_header.html index 89fe4e49c..84ca2b0c1 100644 --- a/promgen/templates/promgen/shard_header.html +++ b/promgen/templates/promgen/shard_header.html @@ -7,7 +7,7 @@ {% if user.is_superuser %} - {% trans "Admin" %} + {% translate "Admin" %} {% endif %} diff --git a/promgen/templates/promgen/site_detail.html b/promgen/templates/promgen/site_detail.html index 92cc4d60e..c9a30a17f 100644 --- a/promgen/templates/promgen/site_detail.html +++ b/promgen/templates/promgen/site_detail.html @@ -10,7 +10,7 @@
- {% trans "No notifications configured for this project. Please configure some" %} + {% translate "No notifications configured for this project. Please configure some" %}
diff --git a/promgen/templates/promgen/url_list.html b/promgen/templates/promgen/url_list.html index 0e0495def..7ec22f119 100644 --- a/promgen/templates/promgen/url_list.html +++ b/promgen/templates/promgen/url_list.html @@ -42,7 +42,7 @@

From 81aa89a188255aa207de8d6479908d97cc490b8f Mon Sep 17 00:00:00 2001 From: Paul Traylor Date: Mon, 9 Sep 2024 17:13:11 +0900 Subject: [PATCH 2/2] Add translate tag update to git blame. While it's a code change in a sense, the change is changing an alias. Adding it to the blame ignore will make it easier to view actual changes in the diff views. --- .git-blame-ignore-revs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 2349078d5..fa8e69f7f 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -8,3 +8,5 @@ af2c352786f952d819e69b928bf6c99dcde5954b 5821434b42203b1080dcdc480d1ffcf07fe53a90 # Format with Ruff e72aba6d7e5891ac777f533eef6f7520410c9e0b +# Update translate tag. +8c4d552eedba195286c6fbadc2fae3b989cc15f7
{% csrf_token %} - +