mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-11-04 07:05:41 +00:00 
			
		
		
		
	Remove {% jstrans %} tag (#6298)
* Revert {% jstrans %} for .js files
- file extension is enough
* Remove custom jstrans templatetag
* Replace jstrans calls for .html files
- Add "escape=True"
* Allow for custom "escape" argument
* Update custom trans tag
- Cannot pass kwargs in the same way
- Add the "escape" attribute
* Update js translations in html files
			
			
This commit is contained in:
		@@ -276,7 +276,7 @@
 | 
			
		||||
                        },
 | 
			
		||||
                        multi_delete: true,
 | 
			
		||||
                        method: 'DELETE',
 | 
			
		||||
                        title: '{% jstrans "Delete Test Data" %}',
 | 
			
		||||
                        title: '{% trans "Delete Test Data" escape %}',
 | 
			
		||||
                        preFormContent: html,
 | 
			
		||||
                        refreshTable: '#test-result-table',
 | 
			
		||||
                    });
 | 
			
		||||
@@ -293,7 +293,7 @@
 | 
			
		||||
            fields: stockItemTestResultFields({
 | 
			
		||||
                stock_item: {{ item.pk }},
 | 
			
		||||
            }),
 | 
			
		||||
            title: '{% jstrans "Add Test Result" %}',
 | 
			
		||||
            title: '{% trans "Add Test Result" escape %}',
 | 
			
		||||
            refreshTable: '#test-result-table',
 | 
			
		||||
        });
 | 
			
		||||
    });
 | 
			
		||||
 
 | 
			
		||||
@@ -504,7 +504,7 @@ $("#stock-test-report").click(function() {
 | 
			
		||||
$("#print-label").click(function() {
 | 
			
		||||
    printLabels({
 | 
			
		||||
        items: [{{ item.pk }}],
 | 
			
		||||
        singular_name: '{% jstrans "stock item" %}',
 | 
			
		||||
        singular_name: '{% trans "stock item" escape %}',
 | 
			
		||||
        url: '{% url "api-stockitem-label-list" %}',
 | 
			
		||||
        key: 'item',
 | 
			
		||||
    });
 | 
			
		||||
@@ -529,7 +529,7 @@ $('#stock-edit-status').click(function () {
 | 
			
		||||
            status: {},
 | 
			
		||||
        },
 | 
			
		||||
        reload: true,
 | 
			
		||||
        title: '{% jstrans "Edit Stock Status" %}',
 | 
			
		||||
        title: '{% trans "Edit Stock Status" escape %}',
 | 
			
		||||
    });
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
@@ -538,7 +538,7 @@ $('#stock-edit-status').click(function () {
 | 
			
		||||
{% if barcodes %}
 | 
			
		||||
$("#show-qr-code").click(function() {
 | 
			
		||||
    showQRDialog(
 | 
			
		||||
        '{% jstrans "Stock Item QR Code" %}',
 | 
			
		||||
        '{% trans "Stock Item QR Code" escape %}',
 | 
			
		||||
        '{"stockitem": {{ item.pk }} }',
 | 
			
		||||
    );
 | 
			
		||||
});
 | 
			
		||||
@@ -549,7 +549,7 @@ $("#barcode-link").click(function() {
 | 
			
		||||
            stockitem: {{ item.pk }},
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
            title: '{% jstrans "Link Barcode to Stock Item" %}',
 | 
			
		||||
            title: '{% trans "Link Barcode to Stock Item" escape %}',
 | 
			
		||||
        }
 | 
			
		||||
    );
 | 
			
		||||
});
 | 
			
		||||
@@ -625,7 +625,7 @@ $("#stock-convert").click(function() {
 | 
			
		||||
        '{% url "api-stock-item-convert" item.pk %}',
 | 
			
		||||
        {
 | 
			
		||||
            method: 'POST',
 | 
			
		||||
            title: '{% jstrans "Convert Stock Item" %}',
 | 
			
		||||
            title: '{% trans "Convert Stock Item" escape %}',
 | 
			
		||||
            preFormContent: html,
 | 
			
		||||
            reload: true,
 | 
			
		||||
            fields: {
 | 
			
		||||
@@ -659,7 +659,7 @@ $("#stock-return-from-customer").click(function() {
 | 
			
		||||
            },
 | 
			
		||||
        },
 | 
			
		||||
        method: 'POST',
 | 
			
		||||
        title: '{% jstrans "Return to Stock" %}',
 | 
			
		||||
        title: '{% trans "Return to Stock" escape %}',
 | 
			
		||||
        reload: true,
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -286,7 +286,7 @@
 | 
			
		||||
 | 
			
		||||
        printLabels({
 | 
			
		||||
            items: locs,
 | 
			
		||||
            singular_name: '{% jstrans "stock location" %}',
 | 
			
		||||
            singular_name: '{% trans "stock location" escape %}',
 | 
			
		||||
            key: 'location',
 | 
			
		||||
            url: '{% url "api-stocklocation-label-list" %}',
 | 
			
		||||
        });
 | 
			
		||||
@@ -314,7 +314,7 @@
 | 
			
		||||
            {
 | 
			
		||||
                onSuccess: function() {
 | 
			
		||||
                    showMessage(
 | 
			
		||||
                        '{% jstrans "Scanned stock container into this location" %}',
 | 
			
		||||
                        '{% trans "Scanned stock container into this location" escape %}',
 | 
			
		||||
                        {
 | 
			
		||||
                            style: 'success',
 | 
			
		||||
                        }
 | 
			
		||||
@@ -387,7 +387,7 @@
 | 
			
		||||
    {% if barcodes %}
 | 
			
		||||
    $('#show-qr-code').click(function() {
 | 
			
		||||
        showQRDialog(
 | 
			
		||||
            '{% jstrans "Stock Location QR Code" %}',
 | 
			
		||||
            '{% trans "Stock Location QR Code" escape %}',
 | 
			
		||||
            '{"stocklocation": {{ location.pk }} }'
 | 
			
		||||
        );
 | 
			
		||||
    });
 | 
			
		||||
@@ -398,7 +398,7 @@
 | 
			
		||||
                stocklocation: {{ location.pk }},
 | 
			
		||||
            },
 | 
			
		||||
            {
 | 
			
		||||
                title: '{% jstrans "Link Barcode to Stock Location" %}',
 | 
			
		||||
                title: '{% trans "Link Barcode to Stock Location" escape %}',
 | 
			
		||||
            }
 | 
			
		||||
        );
 | 
			
		||||
    });
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user