diff --git a/InvenTree/part/templates/part/part_base.html b/InvenTree/part/templates/part/part_base.html index 0cfd50a115..7f89f87cd3 100644 --- a/InvenTree/part/templates/part/part_base.html +++ b/InvenTree/part/templates/part/part_base.html @@ -471,6 +471,7 @@ printLabels({ items: [{{ part.pk }}], key: 'part', + singular_name: '{% trans "part" %}', url: '{% url "api-part-label-list" %}', }); }); diff --git a/InvenTree/stock/templates/stock/item_base.html b/InvenTree/stock/templates/stock/item_base.html index 322ee56235..959b0d7457 100644 --- a/InvenTree/stock/templates/stock/item_base.html +++ b/InvenTree/stock/templates/stock/item_base.html @@ -496,6 +496,7 @@ $("#stock-test-report").click(function() { $("#print-label").click(function() { printLabels({ items: [{{ item.pk }}], + singular_name: '{% trans "stock item" %}', url: '{% url "api-stockitem-label-list" %}', key: 'item', }); diff --git a/InvenTree/stock/templates/stock/location.html b/InvenTree/stock/templates/stock/location.html index f1820f08d3..b97194899e 100644 --- a/InvenTree/stock/templates/stock/location.html +++ b/InvenTree/stock/templates/stock/location.html @@ -284,6 +284,7 @@ printLabels({ items: locs, + singular_name: '{% trans "stock location" %}', key: 'location', url: '{% url "api-stocklocation-label-list" %}', }); diff --git a/InvenTree/templates/js/translated/build.js b/InvenTree/templates/js/translated/build.js index c9184e22fe..f22eec19a4 100644 --- a/InvenTree/templates/js/translated/build.js +++ b/InvenTree/templates/js/translated/build.js @@ -889,7 +889,9 @@ function loadBuildOutputTable(build_info, options={}) { labels: { url: '{% url "api-stockitem-label-list" %}', key: 'item', - } + }, + singular_name: '{% trans "build output" %}', + plural_name: '{% trans "build outputs" %}', }); function setupBuildOutputButtonCallbacks() { diff --git a/InvenTree/templates/js/translated/filters.js b/InvenTree/templates/js/translated/filters.js index 965717daff..bc352edf33 100644 --- a/InvenTree/templates/js/translated/filters.js +++ b/InvenTree/templates/js/translated/filters.js @@ -419,6 +419,8 @@ function setupFilterList(tableKey, table, target, options={}) { printLabels({ items: items, + singular_name: options.singular_name, + plural_name: options.plural_name, url: options.labels.url, key: options.labels.key, }); diff --git a/InvenTree/templates/js/translated/label.js b/InvenTree/templates/js/translated/label.js index f714e0f861..1c8543c22d 100644 --- a/InvenTree/templates/js/translated/label.js +++ b/InvenTree/templates/js/translated/label.js @@ -96,10 +96,10 @@ function selectLabel(labels, items, options={}) { var html = ''; if (items.length > 0) { - + name = items.length == 1 ? options.singular_name : options.plural_name; html += `