2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-18 13:05:42 +00:00

Add translatable strings

This commit is contained in:
Oliver Walters
2020-02-02 21:43:10 +11:00
parent 5264f816f1
commit d0a7a24649
13 changed files with 610 additions and 210 deletions

View File

@ -1,9 +1,10 @@
{% extends "base.html" %}
{% load static %}
{% load i18n %}
{% block page_title %}
InvenTree | Company - {{ company.name }}
InvenTree | {% trans "Company" %} - {{ company.name }}
{% endblock %}
{% block content %}
@ -44,27 +45,27 @@ InvenTree | Company - {{ company.name }}
<table class="table">
{% if company.website %}
<tr>
<td>Website</td><td><a href="{{ company.website }}">{{ company.website }}</a></td>
<td>{% trans "Website" %}</td><td><a href="{{ company.website }}">{{ company.website }}</a></td>
</tr>
{% endif %}
{% if company.address %}
<tr>
<td>Address</td><td>{{ company.address }}</td>
<td>{% trans "Address" %}</td><td>{{ company.address }}</td>
</tr>
{% endif %}
{% if company.phone %}
<tr>
<td>Phone</td><td>{{ company.phone }}</td>
<td>{% trans "Phone" %}</td><td>{{ company.phone }}</td>
</tr>
{% endif %}
{% if company.email %}
<tr>
<td>Email</td><td>{{ company.email }}</td>
<td>{% trans "Email" %}</td><td>{{ company.email }}</td>
</tr>
{% endif %}
{% if company.contact %}
<tr>
<td>Contact</td><td>{{ company.contact }}</td>
<td>{% trans "Contact" %}</td><td>{{ company.contact }}</td>
</tr>
{% endif %}
</table>

View File

@ -1,19 +1,20 @@
{% extends "company/company_base.html" %}
{% load static %}
{% load i18n %}}
{% block details %}
{% include 'company/tabs.html' with tab='details' %}
<h4>Company Details</h4>
<h4>{% trans "Company Details" %}</h4>
<hr>
<table class='table table-striped'>
<tr>
<td>Customer</td>
<td>{% trans "Customer" %}</td>
<td>{% include 'yesnolabel.html' with value=company.is_customer %}</td>
</tr>
<tr>
<td>Supplier</td>
<td>{% trans "Supplier" %}</td>
<td>{% include 'yesnolabel.html' with value=company.is_supplier %}</td>
</tr>
</table>

View File

@ -1,21 +1,22 @@
{% extends "company/company_base.html" %}
{% load static %}
{% block details %}
{% load i18n %}
{% include 'company/tabs.html' with tab='parts' %}
<h4>Supplier Parts</h4>
<h4>{% trans "Supplier Parts" %}</h4>
<hr>
<div id='button-toolbar'>
<button class="btn btn-success" id='part-create'>New Supplier Part</button>
<button class="btn btn-success" id='part-create'>{% trans "New Supplier Part" %}</button>
<div class="dropdown" style="float: right;">
<button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">Options
<button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">{% trans "Options" %}
<span class="caret"></span></button>
<ul class="dropdown-menu">
<li><a href='#' id='multi-part-order' title='Order parts'>Order Parts</a></li>
<li><a href='#' id='multi-part-delete' title='Delete parts'>Delete Parts</a></li>
<li><a href='#' id='multi-part-order' title='Order parts'>{% trans "Order Parts" %}</a></li>
<li><a href='#' id='multi-part-delete' title='Delete parts'>{% trans "Delete Parts" %}</a></li>
</ul>
</div>
</div>
@ -61,7 +62,7 @@
{
sortable: true,
field: 'part_detail.full_name',
title: 'Part',
title: '{% trans "Part" %}',
formatter: function(value, row, index, field) {
return imageHoverIcon(row.part_detail.image_url) + renderLink(value, '/part/' + row.part + '/suppliers/');
}
@ -69,7 +70,7 @@
{
sortable: true,
field: 'SKU',
title: 'SKU',
title: '{% trans "SKU" %}',
formatter: function(value, row, index, field) {
return renderLink(value, row.url);
}
@ -77,7 +78,7 @@
{
sortable: true,
field: 'manufacturer',
title: 'Manufacturer',
title: '{% trans "Manufacturer" %}',
},
{
sortable: true,
@ -86,7 +87,7 @@
},
{
field: 'URL',
title: 'URL',
title: '{% trans "URL" %}',
formatter: function(value, row, index, field) {
if (value) {
return renderLink(value, value);

View File

@ -1,15 +1,16 @@
{% extends "company/company_base.html" %}
{% load static %}
{% block details %}
{% load i18n %}
{% include 'company/tabs.html' with tab='po' %}
<h4>Open Purchase Orders</h4>
<h4>{% trans "Purchase Orders" %}</h4>
<hr>
<div id='button-bar'>
<div class='btn-group'>
<button class='btn btn-primary' type='button' id='company-order2' title='Create new purchase order'>New Purchase Order</button>
<button class='btn btn-primary' type='button' id='company-order2' title='Create new purchase order'>{% trans "New Purchase Order" %}</button>
</div>
</div>

View File

@ -1,11 +1,12 @@
{% extends "company/company_base.html" %}
{% load static %}
{% load i18n %}
{% block details %}
{% include "company/tabs.html" with tab='stock' %}
<h4>Supplier Stock</h4>
<h4>{% trans "Supplier Stock" %}</h4>
<hr>
@ -29,7 +30,7 @@
$("#stock-export").click(function() {
launchModalForm("{% url 'stock-export-options' %}", {
submit_text: "Export",
submit_text: '{% trans "Export" %}',
success: function(response) {
var url = "{% url 'stock-export' %}";

View File

@ -1,19 +1,20 @@
{% extends "base.html" %}
{% load static %}
{% load i18n %}
{% block page_title %}
InvenTree | Supplier List
InvenTree | {% trans "Supplier List" %}
{% endblock %}
{% block content %}
<h3>Supplier List</h3>
<h3>{% trans "Supplier List" %}</h3>
<hr>
<div id='button-toolbar'>
<div class='btn-group'>
<button type='button' class="btn btn-success" id='new-company' title='Add new supplier'>New Supplier</button>
<button type='button' class="btn btn-success" id='new-company' title='Add new supplier'>{% trans "New Supplier" %}</button>
</div>
</div>
@ -37,12 +38,12 @@ InvenTree | Supplier List
columns: [
{
field: 'pk',
title: 'ID',
title: '{% trans "ID" %}',
visible: false,
},
{
field: 'name',
title: 'Supplier',
title: '{% trans "Supplier" %}',
sortable: true,
formatter: function(value, row, index, field) {
return imageHoverIcon(row.image) + renderLink(value, row.url);
@ -50,12 +51,12 @@ InvenTree | Supplier List
},
{
field: 'description',
title: 'Description',
title: '{% trans "Description" %}',
sortable: true,
},
{
field: 'website',
title: 'Website',
title: '{% trans "Website" %}',
formatter: function(value, row, index, field) {
if (value) {
return renderLink(value, value);
@ -65,7 +66,7 @@ InvenTree | Supplier List
},
{
field: 'part_count',
title: 'Parts',
title: '{% trans "Parts" %}',
sortable: true,
formatter: function(value, row, index, field) {
return renderLink(value, row.url + 'parts/');

View File

@ -1,49 +0,0 @@
{% extends "base.html" %}
{% block content %}
<h3>Supplier Order Details</h3>
<table class='table table-striped'>
<tr>
<td>Reference</td>
<td>{{ order.internal_ref }}</td>
</tr>
<tr>
<td>Supplier</td>
<td>
{% if order.supplier %}
<a href="{% url 'supplier-detail-orders' order.supplier.id %}">{{ order.supplier.name }}</a>
{% endif %}
</td>
</tr>
<tr>
<td>Status</td>
<td>{% include "supplier/order_status.html" with order=order %}</td>
</tr>
<tr>
<td>Created Date</td>
<td>{{ order.created_date }}</td>
</tr>
<tr>
<td>Issued Date</td>
<td>{{ order.issued_date }}</td>
</tr>
<tr>
<td>Delivered Date</td>
<td>{{ order.delivery_date }}</td>
</tr>
</table>
{% if order.notes %}
<div class="panel panel-default">
<div class="panel-heading"><b>Notes</b></div>
<div class="panel-body">{{ order.notes }}</div>
</div>
{% endif %}
<h2>TODO</h2>
Here we list all the line ites which exist under this order...
{% endblock %}

View File

@ -1,15 +1,16 @@
{% extends "base.html" %}
{% load static %}
{% load i18n %}
{% block page_title %}
InvenTree | {{ company.name }} - Parts
InvenTree | {{ company.name }} - {% trans "Parts" %}
{% endblock %}
{% block content %}
<div class='row'>
<div class='col-sm-6'>
<h3>Supplier Part</h3>
<h3>{% trans "Supplier Part" %}</h3>
<div class='btn-row'>
<div class='btn-group'>
<button type='button' class='btn btn-default btn-glyph' id='edit-part' title='Edit supplier part'>
@ -37,52 +38,52 @@ InvenTree | {{ company.name }} - Parts
<div class='row'>
<div class='col-sm-6'>
<h4>Supplier Part Details</h4>
<h4>{% trans "Supplier Part Details" %}</h4>
<table class="table table-striped table-condensed">
<tr>
<td>Internal Part</td>
<td>{% trans "Internal Part" %}</td>
<td>
{% if part.part %}
<a href="{% url 'part-suppliers' part.part.id %}">{{ part.part.full_name }}</a>
{% endif %}
</td>
</tr>
<tr><td>Supplier</td><td><a href="{% url 'company-detail-parts' part.supplier.id %}">{{ part.supplier.name }}</a></td></tr>
<tr><td>SKU</td><td>{{ part.SKU }}</tr></tr>
<tr><td>{% trans "Supplier" %}</td><td><a href="{% url 'company-detail-parts' part.supplier.id %}">{{ part.supplier.name }}</a></td></tr>
<tr><td>{% trans "SKU" %}</td><td>{{ part.SKU }}</tr></tr>
{% if part.URL %}
<tr><td>URL</td><td><a href="{{ part.URL }}">{{ part.URL }}</a></td></tr>
<tr><td>{% trans "URL" %}</td><td><a href="{{ part.URL }}">{{ part.URL }}</a></td></tr>
{% endif %}
{% if part.description %}
<tr><td>Description</td><td>{{ part.description }}</td></tr>
<tr><td>{% trans "Description" %}</td><td>{{ part.description }}</td></tr>
{% endif %}
{% if part.manufacturer %}
<tr><td>Manufacturer</td><td>{{ part.manufacturer }}</td></tr>
<tr><td>MPN</td><td>{{ part.MPN }}</td></tr>
<tr><td>{% trans "Manufacturer" %}</td><td>{{ part.manufacturer }}</td></tr>
<tr><td>{% trans "MPN" %}</td><td>{{ part.MPN }}</td></tr>
{% endif %}
{% if part.note %}
<tr><td>Note</td><td>{{ part.note }}</td></tr>
<tr><td>{% trans "Note" %}</td><td>{{ part.note }}</td></tr>
{% endif %}
</table>
</div>
<div class='col-sm-6'>
<h4>Pricing Information</h4>
<h4>{% trans "Pricing Information" %}</h4>
<table class="table table-striped table-condensed">
<tr><td>Order Multiple</td><td>{{ part.multiple }}</td></tr>
<tr><td>{% trans "Order Multiple" %}</td><td>{{ part.multiple }}</td></tr>
{% if part.base_cost > 0 %}
<tr><td>Base Price (Flat Fee)</td><td>{{ part.base_cost }}</td></tr>
<tr><td>{% trans "Base Price (Flat Fee)" %}</td><td>{{ part.base_cost }}</td></tr>
{% endif %}
<tr>
<th>Price Breaks</th>
<th>{% trans "Price Breaks" %}</th>
<th>
<div style='float: right;'>
<button class='btn btn-primary' id='new-price-break' type='button'>New Price Break</button>
<button class='btn btn-primary' id='new-price-break' type='button'>{% trans "New Price Break" %}</button>
</div>
</th>
</tr>
<tr>
<th>Quantity</th>
<th>Price</th>
<th>{% trans "Quantity" %}</th>
<th>{% trans "Price" %}</th>
</tr>
{% if part.price_breaks.all %}
{% for pb in part.price_breaks.all %}
@ -102,7 +103,7 @@ InvenTree | {{ company.name }} - Parts
{% else %}
<tr>
<td colspan='2'>
<span class='warning-msg'><i>No price breaks have been added for this part</i></span>
<span class='warning-msg'><i>{% trans "No price breaks have been added for this part" %}</i></span>
</td>
</tr>
{% endif %}
@ -112,7 +113,7 @@ InvenTree | {{ company.name }} - Parts
<hr>
<h4>Purchase Orders</h4>
<h4>{% trans "Purchase Orders" %}</h4>
{% include "order/po_table.html" with orders=part.purchase_orders %}
{% endblock %}