Add translation hooks for part detail template

This commit is contained in:
Oliver Walters 2019-09-27 10:12:46 +10:00
parent 225ad0ffa6
commit b870728125
5 changed files with 382 additions and 45 deletions

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-09-27 00:03+0000\n"
"POT-Creation-Date: 2019-09-27 00:12+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -365,11 +365,11 @@ msgstr ""
msgid "Category Description"
msgstr ""
#: part/templates/part/category.html:46
#: part/templates/part/category.html:46 part/templates/part/detail.html:63
msgid "Default Location"
msgstr ""
#: part/templates/part/category.html:52
#: part/templates/part/category.html:52 part/templates/part/detail.html:43
msgid "Keywords"
msgstr ""
@ -381,7 +381,7 @@ msgstr ""
msgid "Parts (Including subcategories)"
msgstr ""
#: part/templates/part/category.html:66
#: part/templates/part/category.html:66 part/templates/part/detail.html:8
msgid "Part Details"
msgstr ""
@ -389,6 +389,118 @@ msgstr ""
msgid "Parts"
msgstr ""
#: part/templates/part/detail.html:16
msgid "Part name"
msgstr ""
#: part/templates/part/detail.html:21
msgid "IPN"
msgstr ""
#: part/templates/part/detail.html:27
msgid "Revision"
msgstr ""
#: part/templates/part/detail.html:32
msgid "Description"
msgstr ""
#: part/templates/part/detail.html:37
msgid "Variant Of"
msgstr ""
#: part/templates/part/detail.html:49
msgid "URL"
msgstr ""
#: part/templates/part/detail.html:54
msgid "Category"
msgstr ""
#: part/templates/part/detail.html:69
msgid "Default Supplier"
msgstr ""
#: part/templates/part/detail.html:76
msgid "Units"
msgstr ""
#: part/templates/part/detail.html:81
msgid "Minimum Stock"
msgstr ""
#: part/templates/part/detail.html:90
msgid "Virtual"
msgstr ""
#: part/templates/part/detail.html:93
msgid "Part is virtual (not a physical part)"
msgstr ""
#: part/templates/part/detail.html:95
msgid "Part is not a virtual part"
msgstr ""
#: part/templates/part/detail.html:99
msgid "Assembly"
msgstr ""
#: part/templates/part/detail.html:102
msgid "Part can be assembled from other parts"
msgstr ""
#: part/templates/part/detail.html:104
msgid "Part cannot be assembled from other parts"
msgstr ""
#: part/templates/part/detail.html:108
msgid "Component"
msgstr ""
#: part/templates/part/detail.html:111
msgid "Part can be used in assemblies"
msgstr ""
#: part/templates/part/detail.html:113
msgid "Part cannot be used in assemblies"
msgstr ""
#: part/templates/part/detail.html:117
msgid "Trackable"
msgstr ""
#: part/templates/part/detail.html:120
msgid "Part stock is tracked by serial number"
msgstr ""
#: part/templates/part/detail.html:122
msgid "Part stock is not tracked by serial number"
msgstr ""
#: part/templates/part/detail.html:126
msgid "Purchaseable"
msgstr ""
#: part/templates/part/detail.html:129 part/templates/part/detail.html:131
msgid "Part can be purchased from external suppliers"
msgstr ""
#: part/templates/part/detail.html:136
msgid "Sellable"
msgstr ""
#: part/templates/part/detail.html:139
msgid "Part can be sold to customers"
msgstr ""
#: part/templates/part/detail.html:141
msgid "Part cannot be sold to customers"
msgstr ""
#: part/templates/part/detail.html:151
msgid "Notes"
msgstr ""
#: part/views.py:196
#, python-brace-format
msgid "Set category for {n} parts"

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-09-27 00:03+0000\n"
"POT-Creation-Date: 2019-09-27 00:12+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -365,11 +365,11 @@ msgstr ""
msgid "Category Description"
msgstr ""
#: part/templates/part/category.html:46
#: part/templates/part/category.html:46 part/templates/part/detail.html:63
msgid "Default Location"
msgstr ""
#: part/templates/part/category.html:52
#: part/templates/part/category.html:52 part/templates/part/detail.html:43
msgid "Keywords"
msgstr ""
@ -381,7 +381,7 @@ msgstr ""
msgid "Parts (Including subcategories)"
msgstr ""
#: part/templates/part/category.html:66
#: part/templates/part/category.html:66 part/templates/part/detail.html:8
msgid "Part Details"
msgstr ""
@ -389,6 +389,118 @@ msgstr ""
msgid "Parts"
msgstr ""
#: part/templates/part/detail.html:16
msgid "Part name"
msgstr ""
#: part/templates/part/detail.html:21
msgid "IPN"
msgstr ""
#: part/templates/part/detail.html:27
msgid "Revision"
msgstr ""
#: part/templates/part/detail.html:32
msgid "Description"
msgstr ""
#: part/templates/part/detail.html:37
msgid "Variant Of"
msgstr ""
#: part/templates/part/detail.html:49
msgid "URL"
msgstr ""
#: part/templates/part/detail.html:54
msgid "Category"
msgstr ""
#: part/templates/part/detail.html:69
msgid "Default Supplier"
msgstr ""
#: part/templates/part/detail.html:76
msgid "Units"
msgstr ""
#: part/templates/part/detail.html:81
msgid "Minimum Stock"
msgstr ""
#: part/templates/part/detail.html:90
msgid "Virtual"
msgstr ""
#: part/templates/part/detail.html:93
msgid "Part is virtual (not a physical part)"
msgstr ""
#: part/templates/part/detail.html:95
msgid "Part is not a virtual part"
msgstr ""
#: part/templates/part/detail.html:99
msgid "Assembly"
msgstr ""
#: part/templates/part/detail.html:102
msgid "Part can be assembled from other parts"
msgstr ""
#: part/templates/part/detail.html:104
msgid "Part cannot be assembled from other parts"
msgstr ""
#: part/templates/part/detail.html:108
msgid "Component"
msgstr ""
#: part/templates/part/detail.html:111
msgid "Part can be used in assemblies"
msgstr ""
#: part/templates/part/detail.html:113
msgid "Part cannot be used in assemblies"
msgstr ""
#: part/templates/part/detail.html:117
msgid "Trackable"
msgstr ""
#: part/templates/part/detail.html:120
msgid "Part stock is tracked by serial number"
msgstr ""
#: part/templates/part/detail.html:122
msgid "Part stock is not tracked by serial number"
msgstr ""
#: part/templates/part/detail.html:126
msgid "Purchaseable"
msgstr ""
#: part/templates/part/detail.html:129 part/templates/part/detail.html:131
msgid "Part can be purchased from external suppliers"
msgstr ""
#: part/templates/part/detail.html:136
msgid "Sellable"
msgstr ""
#: part/templates/part/detail.html:139
msgid "Part can be sold to customers"
msgstr ""
#: part/templates/part/detail.html:141
msgid "Part cannot be sold to customers"
msgstr ""
#: part/templates/part/detail.html:151
msgid "Notes"
msgstr ""
#: part/views.py:196
#, python-brace-format
msgid "Set category for {n} parts"

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-09-27 00:03+0000\n"
"POT-Creation-Date: 2019-09-27 00:12+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -365,11 +365,11 @@ msgstr ""
msgid "Category Description"
msgstr ""
#: part/templates/part/category.html:46
#: part/templates/part/category.html:46 part/templates/part/detail.html:63
msgid "Default Location"
msgstr ""
#: part/templates/part/category.html:52
#: part/templates/part/category.html:52 part/templates/part/detail.html:43
msgid "Keywords"
msgstr ""
@ -381,7 +381,7 @@ msgstr ""
msgid "Parts (Including subcategories)"
msgstr ""
#: part/templates/part/category.html:66
#: part/templates/part/category.html:66 part/templates/part/detail.html:8
msgid "Part Details"
msgstr ""
@ -389,6 +389,118 @@ msgstr ""
msgid "Parts"
msgstr ""
#: part/templates/part/detail.html:16
msgid "Part name"
msgstr ""
#: part/templates/part/detail.html:21
msgid "IPN"
msgstr ""
#: part/templates/part/detail.html:27
msgid "Revision"
msgstr ""
#: part/templates/part/detail.html:32
msgid "Description"
msgstr ""
#: part/templates/part/detail.html:37
msgid "Variant Of"
msgstr ""
#: part/templates/part/detail.html:49
msgid "URL"
msgstr ""
#: part/templates/part/detail.html:54
msgid "Category"
msgstr ""
#: part/templates/part/detail.html:69
msgid "Default Supplier"
msgstr ""
#: part/templates/part/detail.html:76
msgid "Units"
msgstr ""
#: part/templates/part/detail.html:81
msgid "Minimum Stock"
msgstr ""
#: part/templates/part/detail.html:90
msgid "Virtual"
msgstr ""
#: part/templates/part/detail.html:93
msgid "Part is virtual (not a physical part)"
msgstr ""
#: part/templates/part/detail.html:95
msgid "Part is not a virtual part"
msgstr ""
#: part/templates/part/detail.html:99
msgid "Assembly"
msgstr ""
#: part/templates/part/detail.html:102
msgid "Part can be assembled from other parts"
msgstr ""
#: part/templates/part/detail.html:104
msgid "Part cannot be assembled from other parts"
msgstr ""
#: part/templates/part/detail.html:108
msgid "Component"
msgstr ""
#: part/templates/part/detail.html:111
msgid "Part can be used in assemblies"
msgstr ""
#: part/templates/part/detail.html:113
msgid "Part cannot be used in assemblies"
msgstr ""
#: part/templates/part/detail.html:117
msgid "Trackable"
msgstr ""
#: part/templates/part/detail.html:120
msgid "Part stock is tracked by serial number"
msgstr ""
#: part/templates/part/detail.html:122
msgid "Part stock is not tracked by serial number"
msgstr ""
#: part/templates/part/detail.html:126
msgid "Purchaseable"
msgstr ""
#: part/templates/part/detail.html:129 part/templates/part/detail.html:131
msgid "Part can be purchased from external suppliers"
msgstr ""
#: part/templates/part/detail.html:136
msgid "Sellable"
msgstr ""
#: part/templates/part/detail.html:139
msgid "Part can be sold to customers"
msgstr ""
#: part/templates/part/detail.html:141
msgid "Part cannot be sold to customers"
msgstr ""
#: part/templates/part/detail.html:151
msgid "Notes"
msgstr ""
#: part/views.py:196
#, python-brace-format
msgid "Set category for {n} parts"

View File

@ -1,10 +1,11 @@
{% extends "part/part_base.html" %}
{% load static %}
{% load i18n %}
{% block details %}
{% include 'part/tabs.html' with tab='detail' %}
<h4>Part Details</h4>
<h4>{% trans "Part Details" %}</h4>
<hr>
@ -12,45 +13,45 @@
<div class='col-sm-6'>
<table class='table table-striped'>
<tr>
<td><b>Part name</b></td>
<td><b>{% trans "Part name" %}</b></td>
<td>{{ part.name }}</td>
</tr>
{% if part.IPN %}
<tr>
<td><b>IPN</b></td>
<td><b>{% trans "IPN" %}</b></td>
<td>{{ part.IPN }}</td>
</tr>
{% endif %}
{% if part.revision %}
<tr>
<td><b>Revision</b></td>
<td><b>{% trans "Revision" %}</b></td>
<td>{{ part.revision }}</td>
</tr>
{% endif %}
<tr>
<td><b>Description</b></td>
<td><b>{% trans "Description" %}</b></td>
<td>{{ part.description }}</td>
</tr>
{% if part.variant_of %}
<tr>
<td><b>Variant Of</b></td>
<td><b>{% trans "Variant Of" %}</b></td>
<td><a href="{% url 'part-detail' part.variant_of.id %}">{{ part.variant_of.full_name }}</a></td>
</tr>
{% endif %}
{% if part.keywords %}
<tr>
<td><b>Keywords</b></td>
<td><b>{% trans "Keywords" %}</b></td>
<td>{{ part.keywords }}</td>
</tr>
{% endif %}
{% if part.URL %}
<tr>
<td><b>URL</b></td>
<td><b>{% trans "URL" %}</b></td>
<td><a href="{{ part.URL }}">{{ part.URL }}</a></td>
</tr>
{% endif %}
<tr>
<td><b>Category</b></td>
<td><b>{% trans "Category" %}</b></td>
<td>
{% if part.category %}
<a href="{% url 'category-detail' part.category.id %}">{{ part.category.pathstring }}</a>
@ -59,25 +60,25 @@
</tr>
{% if part.default_location %}
<tr>
<td><b>Default Location</b></td>
<td><b>{% trans "Default Location" %}</b></td>
<td><a href="{% url 'stock-location-detail' part.default_location.id %}">{{ part.default_location.pathstring }}</a></td>
</tr>
{% endif %}
{% if part.default_supplier %}
<tr>
<td><b>Default Supplier</b></td>
<td><b>{% trans "Default Supplier" %}</b></td>
<td><a href="{% url 'supplier-part-detail' part.default_supplier.id %}">
{{ part.default_supplier.supplier.name }} | {{ part.default_supplier.SKU }}
</a></td>
</tr>
{% endif %}
<tr>
<td><b>Units</b></td>
<td><b>{% trans "Units" %}</b></td>
<td>{{ part.units }}</td>
</tr>
{% if part.minimum_stock > 0 %}
<tr>
<td><b>Minimum Stock</b></td>
<td><b>{% trans "Minimum Stock" %}</b></td>
<td>{{ part.minimum_stock }}</td>
</tr>
{% endif %}
@ -86,58 +87,58 @@
<div class='col-sm-6'>
<table class='table table-striped'>
<tr>
<td><b>Virtual</b></td>
<td><b>{% trans "Virtual" %}</b></td>
<td>{% include "slide.html" with state=part.virtual field='virtual' %}</td>
{% if part.virtual %}
<td>Part is virtual (not a physical part)</td>
<td>{% trans "Part is virtual (not a physical part)" %}</td>
{% else %}
<td><i>Part is not a virtual part</i></td>
<td><i>{% trans "Part is not a virtual part" %}</i></td>
{% endif %}
</tr>
<tr>
<td><b>Assembly</b></td>
<td><b>{% trans "Assembly" %}</b></td>
<td>{% include "slide.html" with state=part.assembly field='assembly' %}</td>
{% if part.assembly %}
<td>Part can be assembled from other parts</td>
<td>{% trans "Part can be assembled from other parts" %}</td>
{% else %}
<td><i>Part cannot be assembled from other parts</i></td>
<td><i>{% trans "Part cannot be assembled from other parts" %}</i></td>
{% endif %}
</tr>
<tr>
<td><b>Component</b></td>
<td><b>{% trans "Component" %}</b></td>
<td>{% include "slide.html" with state=part.component field='component' %}</td>
{% if part.component %}
<td>Part can be used in assemblies</td>
<td>{% trans "Part can be used in assemblies" %}</td>
{% else %}
<td><i>Part cannot be used in assemblies</i></td>
<td><i>{% trans "Part cannot be used in assemblies" %}</i></td>
{% endif %}
</tr>
<tr>
<td><b>Trackable</b></td>
<td><b>{% trans "Trackable" %}</b></td>
<td>{% include "slide.html" with state=part.trackable field='trackable' %}</td>
{% if part.trackable %}
<td>Part stock is tracked by serial number</td>
<td>{% trans "Part stock is tracked by serial number" %}</td>
{% else %}
<td><i>Part stock is not tracked by serial number</i></td>
<td><i>{% trans "Part stock is not tracked by serial number" %}</i></td>
{% endif %}
</tr>
<tr>
<td><b>Purchaseable</b></td>
<td><b>{% trans "Purchaseable" %}</b></td>
<td>{% include "slide.html" with state=part.purchaseable field='purchaseable' %}</td>
{% if part.purchaseable %}
<td>Part can be purchased from external suppliers</td>
<td>{% trans "Part can be purchased from external suppliers" %}</td>
{% else %}
<td><i>Part can be purchased from external suppliers</i></td>
<td><i>{% trans "Part can be purchased from external suppliers" %}</i></td>
{% endif %}
</tr>
{% if 0 %}
<tr>
<td><b>Sellable</b></td>
<td><b>{% trans "Sellable" %}</b></td>
<td>{% include "slide.html" with state=part.salable field='salable' %}</td>
{% if part.salable %}
<td>Part can be sold to customers</td>
<td>{% trans "Part can be sold to customers" %}</td>
{% else %}
<td><i>Part cannot be sold to customers</i></td>
<td><i>{% trans "Part cannot be sold to customers" %}</i></td>
{% endif %}
</tr>
{% endif %}
@ -147,7 +148,7 @@
{% if part.notes %}
<div class="panel panel-default">
<div class="panel-heading"><b>Notes</b></div>
<div class="panel-heading"><b>{% trans "Notes" %}</b></div>
<div class="panel-body">{{ part.notes }}</div>
</div>
{% endif %}

View File

@ -18,7 +18,7 @@ locales = []
for line in str(out.decode()).split('\n'):
# Check for any compiled translation files that have not been committed
if 'modified:' in line and '/locale/' in line and 'django.mo' in line:
if 'modified:' in line and '/locale/' in line and 'django.po' in line:
locales.append(line)
if len(locales) > 0: