Skip to content

Commit

Permalink
Fixes #13351: Fix missing text due to incorrectly applied translation…
Browse files Browse the repository at this point in the history
… tags
  • Loading branch information
jeremystretch committed Aug 2, 2023
1 parent 82c9595 commit 04a2543
Show file tree
Hide file tree
Showing 24 changed files with 120 additions and 29 deletions.
8 changes: 8 additions & 0 deletions docs/release-notes/version-3.6.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# NetBox v3.6

## v3.6-beta2 (FUTURE)

### Bug Fixes

* [#13351](https://github.com/netbox-community/netbox/issues/13351) - Fix missing text due to incorrectly applied translation tags

---

## v3.6-beta1 (2023-08-02)

### Breaking Changes
Expand Down
7 changes: 6 additions & 1 deletion netbox/templates/core/job.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,12 @@ <h5 class="card-header">{% trans "Scheduling" %}</h5>
</tr>
<tr>
<th scope="row">{% trans "Scheduled" %}</th>
<td>{{ object.scheduled|annotated_date|placeholder }}{% if object.interval %} ({% blocktrans %}every {{ object.interval }} seconds{% endblocktrans %}){% endif %}</td>
<td>
{{ object.scheduled|annotated_date|placeholder }}
{% if object.interval %}
({% blocktrans with interval=object.interval %}every {{ interval }} seconds{% endblocktrans %})
{% endif %}
</td>
</tr>
<tr>
<th scope="row">{% trans "Started" %}</th>
Expand Down
6 changes: 5 additions & 1 deletion netbox/templates/dcim/bulk_disconnect.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
{% block title %}{% trans "Disconnect" %} {{ obj_type_plural|bettertitle }}{% endblock %}

{% block message %}
<p>{% blocktrans %}Are you sure you want to disconnect these {{ selected_objects|length }} {{ obj_type_plural }}?{% endblocktrans %}</p>
<p>
{% blocktrans with count=selected_objects|length %}
Are you sure you want to disconnect these {{ count }} {{ obj_type_plural }}?
{% endblocktrans %}
</p>
<ul>
{% for obj in selected_objects %}
<li>{{ obj }}</li>
Expand Down
6 changes: 5 additions & 1 deletion netbox/templates/dcim/cable_trace.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
{% load helpers %}
{% load i18n %}

{% block title %}{% blocktrans %}Cable Trace for {{ object|meta:"verbose_name"|bettertitle }} {{ object }}{% endblocktrans %}{% endblock %}
{% block title %}
{% blocktrans with object_type=object|meta:"verbose_name"|bettertitle %}
Cable Trace for {{ object_type }} {{ object }}
{% endblocktrans %}
{% endblock %}

{% block content %}
<div class="row">
Expand Down
4 changes: 3 additions & 1 deletion netbox/templates/dcim/device.html
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,9 @@ <h5 class="card-header">
</tr>
{% for leg in utilization.legs %}
<tr>
<td style="padding-left: 20px">{% blocktrans %}Leg {{ leg.name }}{% endblocktrans %}</td>
<td style="padding-left: 20px">
{% trans "Leg" context "Leg of a power feed" %} {{ leg }}
</td>
<td>{{ leg.outlet_count }}</td>
<td>{{ leg.allocated }}</td>
{% if powerfeed.available_power %}
Expand Down
12 changes: 10 additions & 2 deletions netbox/templates/dcim/devicebay_depopulate.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,16 @@
{% load form_helpers %}
{% load i18n %}

{% block title %}{% blocktrans %}Remove {{ device_bay.installed_device }} from {{ device_bay }}?{% endblocktrans %}{% endblock %}
{% block title %}
{% blocktrans with device=device_bay.installed_device %}
Remove {{ device }} from {{ device_bay }}?
{% endblocktrans %}
{% endblock %}

{% block message %}
<p>{% blocktrans %}Are you sure you want to remove <strong>{{ device_bay.installed_device }}</strong> from <strong>{{ device_bay }}</strong>?{% endblocktrans %}</p>
<p>
{% blocktrans with device=device_bay.installed_device %}
Are you sure you want to remove <strong>{{ device }}</strong> from <strong>{{ device_bay }}</strong>?
{% endblocktrans %}
</p>
{% endblock %}
10 changes: 8 additions & 2 deletions netbox/templates/dcim/inc/nonracked_devices.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,17 @@ <h5 class="card-header">
{% if total_nonracked_devices_count > nonracked_devices.count %}
{% if object|meta:'verbose_name' == 'site' %}
<div class="text-muted">
{% blocktrans %}Displaying {{ nonracked_devices.count }} of {{ total_nonracked_devices_count }} devices{% endblocktrans %} (<a href="{% url 'dcim:device_list' %}?site_id={{ object.pk }}&rack_id=null">{% trans "View full list" %}</a>)
{% blocktrans with count=nonracked_devices.count total=total_nonracked_devices_count %}
Displaying {{ count }} of {{ total }} devices
{% endblocktrans %}
(<a href="{% url 'dcim:device_list' %}?site_id={{ object.pk }}&rack_id=null">{% trans "View full list" %}</a>)
</div>
{% elif object|meta:'verbose_name' == 'location' %}
<div class="text-muted">
{% blocktrans %}Displaying {{ nonracked_devices.count }} of {{ total_nonracked_devices_count }} devices{% endblocktrans %} (<a href="{% url 'dcim:device_list' %}?location_id={{ object.pk }}&rack_id=null">{% trans "View full list" %}</a>)
{% blocktrans with count=nonracked_devices.count total=total_nonracked_devices_count %}
Displaying {{ count }} of {{ total }} devices
{% endblocktrans %}
(<a href="{% url 'dcim:device_list' %}?location_id={{ object.pk }}&rack_id=null">{% trans "View full list" %}</a>)
</div>
{% endif %}
{% endif %}
Expand Down
6 changes: 5 additions & 1 deletion netbox/templates/dcim/virtualchassis_edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
{% load form_helpers %}
{% load i18n %}

{% block title %}{% blocktrans %}Editing Virtual Chassis {{ vc_form.instance }}{% endblocktrans %}{% endblock %}
{% block title %}
{% blocktrans with name=vc_form.instance %}
Editing Virtual Chassis {{ name }}
{% endblocktrans %}
{% endblock %}

{% block content-wrapper %}
<div class="tab-content">
Expand Down
6 changes: 5 additions & 1 deletion netbox/templates/dcim/virtualchassis_remove_member.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,9 @@
{% block title %}{% trans "Remove Virtual Chassis Member" %}?{% endblock %}

{% block message %}
<p>{% blocktrans %}Are you sure you want to remove <strong>{{ device }}</strong> from virtual chassis {{ device.virtual_chassis }}?{% endblocktrans %}</p>
<p>
{% blocktrans with name=device.virtual_chassis %}
Are you sure you want to remove <strong>{{ device }}</strong> from virtual chassis {{ name }}?
{% endblocktrans %}
</p>
{% endblock %}
2 changes: 1 addition & 1 deletion netbox/templates/extras/configrevision_restore.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

{% block subtitle %}
<div class="object-subtitle">
<span>{% blocktrans %}Created {{ object.created|annotated_date }}{% endblocktrans %}</span>
<span>{% trans "Created" %} {{ object.created|annotated_date }}</span>
</div>
{% endblock %}

Expand Down
4 changes: 3 additions & 1 deletion netbox/templates/generic/bulk_add_component.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
{% load render_table from django_tables2 %}
{% load i18n %}

{% block title %}{% blocktrans %}Add {{ model_name|title }}{% endblocktrans %}{% endblock %}
{% block title %}
{% trans "Add" %} {{ model_name|title }}
{% endblock %}

{% block tabs %}
<ul class="nav nav-tabs px-3">
Expand Down
4 changes: 3 additions & 1 deletion netbox/templates/generic/bulk_delete.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
return_url: The URL to which the user is redirected after submitting the form
{% endcomment %}

{% block title %}{% blocktrans %}Delete {{ table.rows|length }} {{ model|meta:"verbose_name_plural"|bettertitle }}?{% endblocktrans %}{% endblock %}
{% block title %}
{% trans "Delete" %} {{ table.rows|length }} {{ model|meta:"verbose_name_plural"|bettertitle }}?
{% endblock %}

{% block content %}
<div class="container-md px-0">
Expand Down
4 changes: 3 additions & 1 deletion netbox/templates/generic/bulk_edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
return_url: The URL to which the user is redirected after submitting the form
{% endcomment %}

{% block title %}{% blocktrans %}Editing {{ table.rows|length }} {{ model|meta:"verbose_name_plural"|bettertitle }}{% endblocktrans %}{% endblock %}
{% block title %}
{% trans "Editing" %} {{ table.rows|length }} {{ model|meta:"verbose_name_plural"|bettertitle }}
{% endblock %}

{% block tabs %}
<ul class="nav nav-tabs px-3">
Expand Down
22 changes: 18 additions & 4 deletions netbox/templates/generic/bulk_remove.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,25 @@
{% load render_table from django_tables2 %}
{% load i18n %}

{% block title %}{% blocktrans %}Remove {{ table.rows|length }} {{ obj_type_plural|bettertitle }}?{% endblocktrans %}{% endblock %}
{% block title %}
{% trans "Remove" %} {{ table.rows|length }} {{ obj_type_plural|bettertitle }}?
{% endblock %}

{% block content %}
<div class="container-md px-0">
<div class="alert alert-danger" role="alert">
<h4 class="alert-heading">{% trans "Confirm Bulk Removal" %}</h4>
<p><strong>{% blocktrans %}Warning:</strong> The following operation will remove {{ table.rows|length }} {{ obj_type_plural }} from {{ parent_obj }}.{% endblocktrans %}</p>
<p>
{% blocktrans with count=table.rows|length %}
<strong>Warning:</strong> The following operation will remove {{ count }} {{ obj_type_plural }} from {{ parent_obj }}.
{% endblocktrans %}
</p>
<hr />
<p class="mb-0">{% blocktrans %}Please carefully review the {{ obj_type_plural }} to be removed and confirm below.{% endblocktrans %}</p>
<p class="mb-0">
{% blocktrans %}
Please carefully review the {{ obj_type_plural }} to be removed and confirm below.
{% endblocktrans %}
</p>
</div>
</div>
<div class="container-xl px-0">
Expand All @@ -24,7 +34,11 @@ <h4 class="alert-heading">{% trans "Confirm Bulk Removal" %}</h4>
{{ field }}
{% endfor %}
<div class="text-center">
<button type="submit" name="_confirm" class="btn btn-danger">{% blocktrans %}Delete these {{ table.rows|length }} {{ obj_type_plural }}{% endblocktrans %}</button>
<button type="submit" name="_confirm" class="btn btn-danger">
{% blocktrans with count=table.rows|length %}
Delete these {{ count }} {{ obj_type_plural }}
{% endblocktrans %}
</button>
<a href="{{ return_url }}" class="btn btn-outline-dark">{% trans "Cancel" %}</a>
</div>
</form>
Expand Down
4 changes: 3 additions & 1 deletion netbox/templates/generic/bulk_rename.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
{% load form_helpers %}
{% load i18n %}

{% block title %}{% blocktrans %}Renaming {{ selected_objects|length }} {{ obj_type_plural|bettertitle }}{% endblocktrans %}{% endblock %}
{% block title %}
{% trans "Renaming" %} {{ selected_objects|length }} {{ obj_type_plural|bettertitle }}
{% endblock %}

{% block content %}
<div class="row mb-3">
Expand Down
4 changes: 3 additions & 1 deletion netbox/templates/generic/object_delete.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
return_url: The URL to which the user is redirected after submitting the form
{% endcomment %}

{% block title %}{% blocktrans %}Delete {{ object|meta:"verbose_name" }}?{% endblocktrans %}{% endblock %}
{% block title %}
{% trans "Delete" %} {{ object|meta:"verbose_name" }}?
{% endblock %}

{% block header %}{% endblock %}

Expand Down
8 changes: 7 additions & 1 deletion netbox/templates/generic/object_edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,13 @@
{% endcomment %}

{% block title %}
{% if object.pk %}{% blocktrans %}Editing {{ object|meta:"verbose_name" }} {{ object }}{% endblocktrans %}{% else %}{% blocktrans %}Add a new {{ object|meta:"verbose_name" }}{% endblocktrans %}{% endif %}
{% if object.pk %}
{% trans "Editing" %} {{ object|meta:"verbose_name" }} {{ object }}
{% else %}
{% blocktrans with object_type=object|meta:"verbose_name" %}
Add a new {{ object_type }}
{% endblocktrans %}
{% endif %}
{% endblock title %}

{% block tabs %}
Expand Down
4 changes: 3 additions & 1 deletion netbox/templates/generic/object_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@
<div class="form-check">
<input type="checkbox" id="select-all" name="_all" class="form-check-input" />
<label for="select-all" class="form-check-label">
{% blocktrans %}Select <strong>all {{ table.rows|length }} {{ table.data.verbose_name_plural }}</strong> matching query{% endblocktrans %}
{% blocktrans with count=table.rows|length object_type_plural=table.data.verbose_name_plural %}
Select <strong>all {{ count }} {{ object_type_plural }}</strong> matching query
{% endblocktrans %}
</label>
</div>
</div>
Expand Down
6 changes: 5 additions & 1 deletion netbox/templates/htmx/delete_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
<h5 class="modal-title">{% trans "Confirm Deletion" %}</h5>
</div>
<div class="modal-body">
<p>{% blocktrans %}Are you sure you want to <strong class="text-danger">delete</strong> {{ object_type }} <strong>{{ object }}</strong>?{% endblocktrans %}</p>
<p>
{% blocktrans %}
Are you sure you want to <strong class="text-danger">delete</strong> {{ object_type }} <strong>{{ object }}</strong>?
{% endblocktrans %}
</p>
{% render_form form %}
</div>
<div class="modal-footer">
Expand Down
2 changes: 1 addition & 1 deletion netbox/templates/htmx/object_selector.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{% load i18n %}

<div class="modal-header">
<h5 class="modal-title">{% blocktrans %}Select {{ model|meta:"verbose_name"|bettertitle }}{% endblocktrans %}</h5>
<h5 class="modal-title">{% trans "Select" %} {{ model|meta:"verbose_name"|bettertitle }}</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body row">
Expand Down
6 changes: 4 additions & 2 deletions netbox/templates/inc/missing_prerequisites.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@

<div class="alert alert-warning text-end" role="alert">
<div class="float-start">
<i class="mdi mdi-alert"></i> {% blocktrans %}Before you can add a {{ model|meta:"verbose_name" }} you must first create a
<strong>{{ prerequisite_model|meta:"verbose_name" }}</strong>.{% endblocktrans %}
<i class="mdi mdi-alert"></i>
{% blocktrans with model=model|meta:"verbose_name" prerequisite_model=prerequisite_model|meta:"verbose_name" %}
Before you can add a {{ model }} you must first create a <strong>{{ prerequisite_model }}</strong>.
{% endblocktrans %}
</div>
{% add_button prerequisite_model %}
</div>
4 changes: 3 additions & 1 deletion netbox/templates/inc/paginator.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@
</ul>
</div>
<small class="text-end text-muted">
{% blocktrans %}Showing {{ page.start_index }}-{{ page.end_index }} of {{ page.paginator.count }}{% endblocktrans %}
{% blocktrans with start=page.start_index end=page.end_index total=page.paginator.count %}
Showing {{ start }}-{{ end }} of {{ total }}
{% endblocktrans %}
</small>
{% endif %}
</div>
Expand Down
4 changes: 3 additions & 1 deletion netbox/templates/inc/paginator_htmx.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@
</ul>
</div>
<small class="text-end text-muted">
{% blocktrans %}Showing {{ page.start_index }}-{{ page.end_index }} of {{ page.paginator.count }}{% endblocktrans %}
{% blocktrans with start=page.start_index end=page.end_index total=page.paginator.count %}
Showing {{ start }}-{{ end }} of {{ total }}
{% endblocktrans %}
</small>
{% endif %}
</div>
Expand Down
6 changes: 5 additions & 1 deletion netbox/templates/virtualization/cluster_add_devices.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@

{% render_errors form %}

{% block title %}{% blocktrans %}Add Device to Cluster {{ cluster }}{% endblocktrans %}{% endblock %}
{% block title %}
{% blocktrans %}
Add Device to Cluster {{ cluster }}
{% endblocktrans %}
{% endblock %}

{% block content %}
<form action="." method="post">
Expand Down

0 comments on commit 04a2543

Please sign in to comment.