1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Closes #13102: Establish initial translation support in templates

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
This commit is contained in:
Arthur Hanson
2023-07-29 03:30:25 +07:00
committed by GitHub
parent cf1b1a83eb
commit 7c17d2e932
257 changed files with 2056 additions and 1762 deletions

View File

@@ -1,23 +1,24 @@
{% load helpers %}
{% load i18n %}
<div class="card">
<h5 class="card-header">Authentication</h5>
<h5 class="card-header">{% trans "Authentication" %}</h5>
<div class="card-body">
<table class="table table-hover attr-table">
<tr>
<th scope="row">Type</th>
<th scope="row">{% trans "Type" %}</th>
<td>{{ object.get_auth_type_display|placeholder }}</td>
</tr>
<tr>
<th scope="row">Cipher</th>
<th scope="row">{% trans "Cipher" %}</th>
<td>{{ object.get_auth_cipher_display|placeholder }}</td>
</tr>
<tr>
<th scope="row">PSK</th>
<th scope="row">{% trans "PSK" %}</th>
<td>
<span id="secret" class="font-monospace" data-secret="{{ object.auth_psk }}">{{ object.auth_psk|placeholder }}</span>
{% if object.auth_psk %}
<button type="button" class="btn btn-sm btn-primary toggle-secret float-end" data-bs-toggle="button">Show Secret</button>
<button type="button" class="btn btn-sm btn-primary toggle-secret float-end" data-bs-toggle="button">{% trans "Show Secret" %}</button>
{% endif %}
</td>
</tr>

View File

@@ -1,47 +1,48 @@
{% load helpers %}
{% load i18n %}
<table class="table table-hover panel-body attr-table">
<tr>
<td>Device</td>
<td>{% trans "Device" %}</td>
<td>{{ interface.device|linkify }}</td>
</tr>
<tr>
<td>Interface</td>
<td>{% trans "Interface" %}</td>
<td>{{ interface|linkify }}</td>
</tr>
<tr>
<td>Type</td>
<td>{% trans "Type" %}</td>
<td>
{{ interface.get_type_display }}
</td>
</tr>
<tr>
<td>Role</td>
<td>{% trans "Role" %}</td>
<td>
{{ interface.get_rf_role_display|placeholder }}
</td>
</tr>
<tr>
<td>Channel</td>
<td>{% trans "Channel" %}</td>
<td>
{{ interface.get_rf_channel_display|placeholder }}
</td>
</tr>
<tr>
<th scope="row">Channel Frequency</th>
<th scope="row">{% trans "Channel Frequency" %}</th>
<td>
{% if interface.rf_channel_frequency %}
{{ interface.rf_channel_frequency|floatformat:"-2" }} MHz
{{ interface.rf_channel_frequency|floatformat:"-2" }} {% trans "MHz" context "Abbreviation for megahertz" %}
{% else %}
{{ ''|placeholder }}
{% endif %}
</td>
</tr>
<tr>
<th scope="row">Channel Width</th>
<th scope="row">{% trans "Channel Width" %}</th>
<td>
{% if interface.rf_channel_width %}
{{ interface.rf_channel_width|floatformat:"-3" }} MHz
{{ interface.rf_channel_width|floatformat:"-3" }} {% trans "MHz" context "Abbreviation for megahertz" %}
{% else %}
{{ ''|placeholder }}
{% endif %}

View File

@@ -2,36 +2,37 @@
{% load helpers %}
{% load plugins %}
{% load render_table from django_tables2 %}
{% load i18n %}
{% block content %}
<div class="row">
<div class="col col-md-6">
<div class="card">
<h5 class="card-header">Wireless LAN</h5>
<h5 class="card-header">{% trans "Wireless LAN" %}</h5>
<div class="card-body">
<table class="table table-hover attr-table">
<tr>
<th scope="row">SSID</th>
<th scope="row">{% trans "SSID" %}</th>
<td>{{ object.ssid }}</td>
</tr>
<tr>
<td>Group</td>
<td>{% trans "Group" %}</td>
<td>{{ object.group|linkify|placeholder }}</td>
</tr>
<tr>
<td>Status</td>
<td>{% trans "Status" %}</td>
<td>{% badge object.get_status_display bg_color=object.get_status_color %}</td>
</tr>
<tr>
<th scope="row">Description</th>
<th scope="row">{% trans "Description" %}</th>
<td>{{ object.description|placeholder }}</td>
</tr>
<tr>
<th scope="row">VLAN</th>
<th scope="row">{% trans "VLAN" %}</th>
<td>{{ object.vlan|linkify|placeholder }}</td>
</tr>
<tr>
<th scope="row">Tenant</th>
<th scope="row">{% trans "Tenant" %}</th>
<td>
{% if object.tenant.group %}
{{ object.tenant.group|linkify }} /
@@ -55,7 +56,7 @@
<div class="row">
<div class="col col-md-12">
<div class="card">
<h5 class="card-header">Attached Interfaces</h5>
<h5 class="card-header">{% trans "Attached Interfaces" %}</h5>
<div class="card-body table-responsive">
{% render_table interfaces_table 'inc/table.html' %}
{% include 'inc/paginator.html' with paginator=interfaces_table.paginator page=interfaces_table.page %}

View File

@@ -2,6 +2,7 @@
{% load helpers %}
{% load plugins %}
{% load render_table from django_tables2 %}
{% load i18n %}
{% block breadcrumbs %}
{{ block.super }}
@@ -13,7 +14,7 @@
{% block extra_controls %}
{% if perms.wireless.add_wirelesslan %}
<a href="{% url 'wireless:wirelesslan_add' %}?group={{ object.pk }}" class="btn btn-sm btn-primary">
<span class="mdi mdi-plus-thick" aria-hidden="true"></span> Add Wireless LAN
<span class="mdi mdi-plus-thick" aria-hidden="true"></span> {% trans "Add Wireless LAN" %}
</a>
{% endif %}
{% endblock extra_controls %}
@@ -22,19 +23,19 @@
<div class="row mb-3">
<div class="col col-md-6">
<div class="card">
<h5 class="card-header">Wireless LAN Group</h5>
<h5 class="card-header">{% trans "Wireless LAN Group" %}</h5>
<div class="card-body">
<table class="table table-hover attr-table">
<tr>
<th scope="row">Name</th>
<th scope="row">{% trans "Name" %}</th>
<td>{{ object.name }}</td>
</tr>
<tr>
<th scope="row">Description</th>
<th scope="row">{% trans "Description" %}</th>
<td>{{ object.description|placeholder }}</td>
</tr>
<tr>
<th scope="row">Parent</th>
<th scope="row">{% trans "Parent" %}</th>
<td>{{ object.parent|linkify|placeholder }}</td>
</tr>
</table>
@@ -52,7 +53,7 @@
<div class="row mb-3">
<div class="col col-md-12">
<div class="card">
<h5 class="card-header">Child Groups</h5>
<h5 class="card-header">{% trans "Child Groups" %}</h5>
<div class="card-body htmx-container table-responsive"
hx-get="{% url 'wireless:wirelesslangroup_list' %}?parent_id={{ object.pk }}"
hx-trigger="load"
@@ -60,7 +61,7 @@
{% if perms.wireless.add_wirelesslangroup %}
<div class="card-footer text-end noprint">
<a href="{% url 'wireless:wirelesslangroup_add' %}?parent={{ object.pk }}" class="btn btn-sm btn-primary">
<span class="mdi mdi-plus-thick" aria-hidden="true"></span> Add Wireless LAN Group
<span class="mdi mdi-plus-thick" aria-hidden="true"></span> {% trans "Add Wireless LAN Group" %}
</a>
</div>
{% endif %}

View File

@@ -1,30 +1,31 @@
{% extends 'generic/object.html' %}
{% load helpers %}
{% load plugins %}
{% load i18n %}
{% block content %}
<div class="row">
<div class="col col-md-6">
<div class="card">
<h5 class="card-header">Interface A</h5>
<h5 class="card-header">{% trans "Interface" %} A</h5>
<div class="card-body">
{% include 'wireless/inc/wirelesslink_interface.html' with interface=object.interface_a %}
</div>
</div>
<div class="card">
<h5 class="card-header">Link Properties</h5>
<h5 class="card-header">{% trans "Link Properties" %}</h5>
<div class="card-body">
<table class="table table-hover attr-table">
<tr>
<th scope="row">Status</th>
<th scope="row">{% trans "Status" %}</th>
<td>{% badge object.get_status_display bg_color=object.get_status_color %}</td>
</tr>
<tr>
<th scope="row">SSID</th>
<th scope="row">{% trans "SSID" %}</th>
<td>{{ object.ssid|placeholder }}</td>
</tr>
<tr>
<th scope="row">Tenant</th>
<th scope="row">{% trans "Tenant" %}</th>
<td>
{% if object.tenant.group %}
{{ object.tenant.group|linkify }} /
@@ -33,7 +34,7 @@
</td>
</tr>
<tr>
<th scope="row">Description</th>
<th scope="row">{% trans "Description" %}</th>
<td>{{ object.description|placeholder }}</td>
</tr>
</table>
@@ -45,7 +46,7 @@
</div>
<div class="col col-md-6">
<div class="card">
<h5 class="card-header">Interface B</h5>
<h5 class="card-header">{% trans "Interface" %} B</h5>
<div class="card-body">
{% include 'wireless/inc/wirelesslink_interface.html' with interface=object.interface_b %}
</div>