diff --git a/InvenTree/common/files.py b/InvenTree/common/files.py
index 786b49e782..5f0e2cb38d 100644
--- a/InvenTree/common/files.py
+++ b/InvenTree/common/files.py
@@ -59,7 +59,8 @@ class FileManager:
# Reset stream position to beginning of file
file.seek(0)
else:
- raise ValidationError(_(f'Unsupported file format: {ext.upper()}'))
+ fmt = ext.upper()
+ raise ValidationError(_(f'Unsupported file format: {fmt}'))
except UnicodeEncodeError:
raise ValidationError(_('Error reading file (invalid encoding)'))
diff --git a/InvenTree/part/templates/part/bom.html b/InvenTree/part/templates/part/bom.html
index e817f60d08..f9bcfc483a 100644
--- a/InvenTree/part/templates/part/bom.html
+++ b/InvenTree/part/templates/part/bom.html
@@ -12,7 +12,7 @@
{% else %}
- {% blocktrans with part=part.full_name %}The BOM for {{ part }} has changed, and must be validated.
{% endblocktrans %}
+ {% trans "The BOM this part has been changed, and must be validated" %}
{% endif %}
{% blocktrans with part=part.full_name checker=part.bom_checked_by check_date=part.bom_checked_date %}The BOM for {{ part }} was last checked by {{ checker }} on {{ check_date }}{% endblocktrans %}
diff --git a/InvenTree/part/templates/part/variant_part.html b/InvenTree/part/templates/part/variant_part.html
index ca274e8076..413e2ff1f3 100644
--- a/InvenTree/part/templates/part/variant_part.html
+++ b/InvenTree/part/templates/part/variant_part.html
@@ -7,7 +7,7 @@
{% trans "Create new part variant" %}
- {% blocktrans with full_name=part.full_name %}Create a new variant of template '{{full_name}}'.{% endblocktrans %}
+ {% trans "Create a new variant part from this template" %}
{% endblock %}
diff --git a/InvenTree/plugin/registry.py b/InvenTree/plugin/registry.py
index b250a0bf19..e8dac3f71e 100644
--- a/InvenTree/plugin/registry.py
+++ b/InvenTree/plugin/registry.py
@@ -447,11 +447,13 @@ class PluginsRegistry:
# Disable plugin
safe_reference(plugin=plg_i, key=plg_key, active=False)
- _msg = _(f'Plugin `{plg_name}` is not compatible with the current InvenTree version {version.inventreeVersion()}!')
- if plg_i.MIN_VERSION:
- _msg += _(f'Plugin requires at least version {plg_i.MIN_VERSION}')
- if plg_i.MAX_VERSION:
- _msg += _(f'Plugin requires at most version {plg_i.MAX_VERSION}')
+ p = plg_name
+ v = version.inventreeVersion()
+ _msg = _(f"Plugin '{p}' is not compatible with the current InvenTree version {v}")
+ if v := plg_i.MIN_VERSION:
+ _msg += _(f'Plugin requires at least version {v}')
+ if v := plg_i.MAX_VERSION:
+ _msg += _(f'Plugin requires at most version {v}')
# Log to error stack
log_error(_msg, reference='init')
else:
diff --git a/InvenTree/stock/models.py b/InvenTree/stock/models.py
index 0d3a28d09f..8ba973aa85 100644
--- a/InvenTree/stock/models.py
+++ b/InvenTree/stock/models.py
@@ -1383,7 +1383,8 @@ class StockItem(InvenTreeBarcodeMixin, MetadataMixin, common.models.MetaMixin, M
if len(existing) > 0:
exists = ','.join([str(x) for x in existing])
- raise ValidationError({"serial_numbers": _("Serial numbers already exist: {exists}").format(exists=exists)})
+ msg = _("Serial numbers already exist") + f": {exists}"
+ raise ValidationError({"serial_numbers": msg})
# Create a new stock item for each unique serial number
for serial in serials:
diff --git a/InvenTree/templates/js/translated/pricing.js b/InvenTree/templates/js/translated/pricing.js
index bef0093417..d0af49fef8 100644
--- a/InvenTree/templates/js/translated/pricing.js
+++ b/InvenTree/templates/js/translated/pricing.js
@@ -607,8 +607,8 @@ function loadPriceBreakTable(table, options={}) {
let buttons = '';
- buttons += makeEditButton(`button-${name}-edit`, row.pk, `{% trans "Edit ${human_name}" %}`);
- buttons += makeDeleteButton(`button-${name}-delete`, row.pk, `{% trans "Delete ${human_name}" %}`);
+ buttons += makeEditButton(`button-${name}-edit`, row.pk, `{% trans "Edit" %} ${human_name}`);
+ buttons += makeDeleteButton(`button-${name}-delete`, row.pk, `{% trans "Delete" %} ${human_name}"`);
html += wrapButtons(buttons);