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

Fix common spelling mistakes (#4956)

* add codespell

* first fixes

* doc fixes

* fix docstrings and comments

* functional changes

* docstrings again

* and docs again

* rename args

* add ignore

* use pre-commit for filtering instead

* ups

* fix typo in filter
This commit is contained in:
Matthias Mair
2023-06-03 16:04:52 +02:00
committed by GitHub
parent 5e2bfaa43a
commit 21ed4b2081
161 changed files with 344 additions and 334 deletions

View File

@ -44,7 +44,7 @@
{% endif %}
</td>
<td>{{ plugin_key }}</td>
{% trans "Unvailable" as no_info %}
{% trans "Unavailable" as no_info %}
<td>
{% if plugin.author %}
{{ plugin.author }}

View File

@ -94,7 +94,7 @@
</div>
<p>{% trans "Some languages are not complete" %}
{% if ALL_LANG %}
. <a href="{% url 'settings' %}">{% trans "Show only sufficent" %}</a>
. <a href="{% url 'settings' %}">{% trans "Show only sufficient" %}</a>
{% else %}
{% trans "and hidden." %} <a href="?alllang">{% trans "Show them too" %}</a>
{% endif %}

View File

@ -95,7 +95,7 @@ $(document).ready(function () {
{% if messages %}
{% for message in messages %}
showMessage("{{ messsage }}");
showMessage("{{ message }}");
{% endfor %}
{% endif %}

View File

@ -226,7 +226,7 @@ function enableBreadcrumbTree(options) {
$('#breadcrumb-tree-toggle').click(function() {
// Add callback to "collapse" and "expand" the sidebar
// Toggle treeview visibilty
// Toggle treeview visibility
$('#breadcrumb-tree-collapse').toggle();
});

View File

@ -111,7 +111,7 @@ function onBarcodeScanClicked(e) {
function onCameraAvailable(hasCamera, options) {
if (hasCamera && global_settings.BARCODE_WEBCAM_SUPPORT) {
// Camera is only acccessible if page is served over secure connection
// Camera is only accessible if page is served over secure connection
if (window.isSecureContext == true) {
qrScanner = new Html5Qrcode('barcode_scan_video', {
useBarCodeDetectorIfSupported: true,

View File

@ -1076,7 +1076,7 @@ function loadBuildOutputTable(build_info, options={}) {
}
});
// Callack for the "unallocate" button
// Callback for the "unallocate" button
$(table).find('.button-output-unallocate').click(function() {
var pk = $(this).attr('pk');
@ -1738,7 +1738,7 @@ function loadBuildOutputAllocationTable(buildInfo, output, options={}) {
// Reload table data
$(table).bootstrapTable('load', bom_items);
// Find the top-level progess bar for this build output
// Find the top-level progress bar for this build output
var output_progress_bar = $(`#output-progress-${outputId}`);
if (output_progress_bar.exists()) {
@ -1789,7 +1789,7 @@ function loadBuildOutputAllocationTable(buildInfo, output, options={}) {
}
function requiredQuantity(row) {
// Return the requied quantity for a given row
// Return the required quantity for a given row
var quantity = 0;
@ -1946,7 +1946,7 @@ function loadBuildOutputAllocationTable(buildInfo, output, options={}) {
},
buttons: constructExpandCollapseButtons(table),
detailFormatter: function(index, row, element) {
// Contruct an 'inner table' which shows which stock items have been allocated
// Construct an 'inner table' which shows which stock items have been allocated
var subTableId = `allocation-table-${outputId}-${row.pk}`;

View File

@ -289,7 +289,7 @@ function editSupplierPart(part, options={}) {
/*
* Delete one or more SupplierPart objects from the database.
* - User will be provided with a modal form, showing all the parts to be deleted.
* - Delete operations are performed sequentialy, not simultaneously
* - Delete operations are performed sequentially, not simultaneously
*/
function deleteSupplierParts(parts, options={}) {
@ -785,7 +785,7 @@ function loadContactTable(table, options={}) {
/* Delete one or more ManufacturerPart objects from the database.
* - User will be provided with a modal form, showing all the parts to be deleted.
* - Delete operations are performed sequentialy, not simultaneously
* - Delete operations are performed sequentially, not simultaneously
*/
function deleteManufacturerParts(selections, options={}) {

View File

@ -1183,7 +1183,7 @@ function handleFormSuccess(response, options) {
var msg_target = null;
if (persist) {
// If the modal is persistant, the target for any messages should be the modal!
// If the modal is persistent, the target for any messages should be the modal!
msg_target = $(options.modal).find('#pre-form-content');
}
@ -1944,7 +1944,7 @@ function initializeRelatedField(field, fields, options={}) {
var html = renderModelData(name, field.model, data, field);
return $(html);
} else {
// Return a simple renderering
// Return a simple rendering
console.warn(`templateResult() missing 'field.model' for '${name}'`);
return `${name} - ${item.id}`;
}
@ -1974,7 +1974,7 @@ function initializeRelatedField(field, fields, options={}) {
var html = renderModelData(name, field.model, data, field);
return $(html);
} else {
// Return a simple renderering
// Return a simple rendering
console.warn(`templateSelection() missing 'field.model' for '${name}'`);
return `${name} - ${item.id}`;
}
@ -2026,7 +2026,7 @@ function initializeRelatedField(field, fields, options={}) {
/*
* Set the value of a select2 instace for a "related field",
* Set the value of a select2 instance for a "related field",
* e.g. with data returned from a secondary modal
*
* arguments:
@ -2431,7 +2431,7 @@ function constructInputOptions(name, classes, type, parameters, options={}) {
opts.push(`value='${parameters.value}'`);
}
} else if (parameters.default != null) {
// Otherwise, a defualt value?
// Otherwise, a default value?
opts.push(`value='${parameters.default}'`);
}

View File

@ -322,7 +322,7 @@ function makeRemoveButton(cls, pk, title, options={}) {
/*
* Render a progessbar!
* Render a progressbar!
*
* @param value is the current value of the progress bar
* @param maximum is the maximum value of the progress bar

View File

@ -193,7 +193,7 @@ function makeOption(text, value, title, selected) {
}
/*
* Programatically generate a list of <option> elements,
* Programmatically generate a list of <option> elements,
* from the (assumed array) of elements.
* For each element, we pass the element to the supplied functions,
* which (in turn) generate display / value / title values.
@ -272,7 +272,7 @@ function setFieldOptions(fieldName, optionList, options={}) {
/**
* Clear (emtpy) the options list for a particular field
* Clear (empty) the options list for a particular field
*/
function clearFieldOptions(fieldName) {
@ -369,7 +369,7 @@ function getFieldValue(fieldName, options={}) {
/* Replacement function for the 'matcher' parameter for a select2 dropdown.
Intead of performing an exact match search, a partial match search is performed.
Instead of performing an exact match search, a partial match search is performed.
This splits the search term by the space ' ' character and matches each segment.
Segments can appear out of order and are not case sensitive
@ -669,7 +669,7 @@ function showQuestionDialog(title, content, options={}) {
* accept_text - Text for the accept button (default = 'Accept')
* cancel_text - Text for the cancel button (default = 'Cancel')
* accept - Function to run if the user presses 'Accept'
* cancel - Functino to run if the user presses 'Cancel'
* cancel - Function to run if the user presses 'Cancel'
*/
options.title = title;

View File

@ -286,7 +286,7 @@ function partFields(options={}) {
/*
* Construct a set of fields for a PartCategory intance
* Construct a set of fields for a PartCategory instance
*/
function categoryFields(options={}) {
let fields = {
@ -687,7 +687,7 @@ function partStockLabel(part, options={}) {
elements.push(`{% trans "On Order" %}: ${part.ordering}`);
}
// Check for items beeing built
// Check for items being built
if (part.building) {
elements.push(`{% trans "Building" %}: ${part.building}`);
}
@ -1287,7 +1287,7 @@ function loadSimplePartTable(table, url, options={}) {
/*
* Construct a set of fields for the PartParameter model.
* Note that the 'data' field changes based on the seleted parameter template
* Note that the 'data' field changes based on the selected parameter template
*/
function partParameterFields(options={}) {
@ -1868,7 +1868,7 @@ function loadPartPurchaseOrderTable(table, part_id, options={}) {
formatter: function(value, row) {
if (row.received >= row.quantity) {
// Already recevied
// Already received
return `<span class='badge bg-success rounded-pill'>{% trans "Received" %}</span>`;
} else if (row.order_detail && row.order_detail.status == {{ PurchaseOrderStatus.PLACED }}) {
let html = '';

View File

@ -65,7 +65,7 @@ function formatCurrency(value, options={}) {
// Extract default currency information
let currency = options.currency || global_settings.INVENTREE_DEFAULT_CURRENCY || 'USD';
// Exctract locale information
// Extract locale information
let locale = options.locale || navigator.language || 'en-US';
let formatter = new Intl.NumberFormat(

View File

@ -1912,7 +1912,7 @@ function loadPurchaseOrderLineItemTable(table, options={}) {
});
});
// Callback for bulk deleting mutliple lines
// Callback for bulk deleting multiple lines
$('#po-lines-bulk-delete').off('click').on('click', function() {
var rows = getTableData(' #po-line-table');

View File

@ -1522,7 +1522,7 @@ function loadSalesOrderAllocationTable(table, options={}) {
/**
* Display an "allocations" sub table, showing stock items allocated againt a sales order
* Display an "allocations" sub table, showing stock items allocated against a sales order
* @param {*} index
* @param {*} row
* @param {*} element
@ -1545,7 +1545,7 @@ function showAllocationSubTable(index, row, element, options) {
var pk = $(this).attr('pk');
// Edit the sales order alloction
// Edit the sales order allocation
constructForm(
`/api/order/so-allocation/${pk}/`,
{

View File

@ -500,17 +500,17 @@ function customGroupSorter(sortName, sortOrder, sortData) {
var bb = sortName.split('.').reduce(extract, b);
// Extract parent information
var aparent = a._data && a._data['parent-index'];
var apparent = a._data && a._data['parent-index'];
var bparent = b._data && b._data['parent-index'];
// If either of the comparisons are in a group
if (aparent || bparent) {
if (apparent || bparent) {
// If the parents are different (or one item does not have a parent,
// then we need to extract the parent value for the selected column.
if (aparent != bparent) {
if (aparent) {
if (apparent != bparent) {
if (apparent) {
aa = a._data['table'].options.groupByFormatter(sortName, 0, a._data['group-data']);
}