From 22068da3faae14568d2f89bd200e040043218023 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 20 Jan 2024 02:40:52 +0000 Subject: [PATCH 1/5] Bump vite from 4.4.12 to 4.5.2 in /src/frontend (#6296) Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 4.4.12 to 4.5.2. - [Release notes](https://github.com/vitejs/vite/releases) - [Changelog](https://github.com/vitejs/vite/blob/v4.5.2/packages/vite/CHANGELOG.md) - [Commits](https://github.com/vitejs/vite/commits/v4.5.2/packages/vite) --- updated-dependencies: - dependency-name: vite dependency-type: direct:development ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- src/frontend/package.json | 2 +- src/frontend/yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/frontend/package.json b/src/frontend/package.json index 7d85d095a6..567f0b6b0b 100644 --- a/src/frontend/package.json +++ b/src/frontend/package.json @@ -61,7 +61,7 @@ "@vitejs/plugin-react": "^4.1.0", "babel-plugin-macros": "^3.1.0", "typescript": "^5.2.2", - "vite": "^4.4.12", + "vite": "^4.5.2", "vite-plugin-babel-macros": "^1.0.6" } } diff --git a/src/frontend/yarn.lock b/src/frontend/yarn.lock index a4262c6b61..3c37df7035 100644 --- a/src/frontend/yarn.lock +++ b/src/frontend/yarn.lock @@ -2972,10 +2972,10 @@ vite-plugin-babel-macros@^1.0.6: "@types/babel__core" "^7.1.18" babel-plugin-macros "^3.1.0" -vite@^4.4.12: - version "4.4.12" - resolved "https://registry.yarnpkg.com/vite/-/vite-4.4.12.tgz#e9c355d5a0d8a47afa46cb4bad10820da333da5c" - integrity sha512-KtPlUbWfxzGVul8Nut8Gw2Qe8sBzWY+8QVc5SL8iRFnpnrcoCaNlzO40c1R6hPmcdTwIPEDkq0Y9+27a5tVbdQ== +vite@^4.5.2: + version "4.5.2" + resolved "https://registry.yarnpkg.com/vite/-/vite-4.5.2.tgz#d6ea8610e099851dad8c7371599969e0f8b97e82" + integrity sha512-tBCZBNSBbHQkaGyhGCDUGqeo2ph8Fstyp6FMSvTtsXeZSPpSMGlviAOav2hxVTqFcx8Hj/twtWKsMJXNY0xI8w== dependencies: esbuild "^0.18.10" postcss "^8.4.27" From e3f6624cf9c485542887a2a30af3e8b0d7456a62 Mon Sep 17 00:00:00 2001 From: Oliver Date: Sat, 20 Jan 2024 15:31:17 +1100 Subject: [PATCH 2/5] SSO config docs (#6297) * Fix django-allauth URLs * Update SSO docs --- docs/docs/settings/SSO.md | 23 ++++++++++++++++------- docs/docs/start/config.md | 12 +++++------- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/docs/docs/settings/SSO.md b/docs/docs/settings/SSO.md index a6c503af1d..351c594b5f 100644 --- a/docs/docs/settings/SSO.md +++ b/docs/docs/settings/SSO.md @@ -16,23 +16,23 @@ InvenTree provides the possibility to use 3rd party services to authenticate use The basic requirements for configuring SSO are outlined below: -1. Enable the required providers in the [config file](../start/config.md#single-sign-on). +1. Enable backend for each required SSO provider(s) in the [config file or environment variables](../start/config.md#single-sign-on). 1. Create an external *app* with your provider of choice 1. Add the required client configurations in the `SocialApp` app in the [admin interface](../settings/admin.md). 1. Configure the *callback* URL for the external app. 1. Enable SSO for the users in the [global settings](../settings/global.md). 1. Configure [e-mail](../settings/email.md). -### Configuration File +### Enable Provider Backends The first step is to ensure that the required provider modules are installed, via your installation [configuration file](../start/config.md#single-sign-on). There are two variables in the configuration file which define the operation of SSO: -| Key | Description | More Info | -| --- | --- | --- | -| `social_backends` | A *list* of provider backends enabled for the InvenTree instance | [django-allauth docs](https://django-allauth.readthedocs.io/en/latest/installation/quickstart.html) | -| `social_providers` | A *dict* of settings specific to the installed providers | [provider documentation](https://django-allauth.readthedocs.io/en/latest/socialaccount/providers/index.html) | +| Environment Variable |Configuration File | Description | More Info | +| --- | --- | --- | --- | +| INVENTREE_SOCIAL_BACKENDS | `social_backends` | A *list* of provider backends enabled for the InvenTree instance | [django-allauth docs](https://django-allauth.readthedocs.io/en/latest/installation/quickstart.html) | +| INVENTREE_SOCIAL_PROVIDERS | `social_providers` | A *dict* of settings specific to the installed providers | [provider documentation](https://django-allauth.readthedocs.io/en/latest/socialaccount/providers/index.html) | In the example below, SSO provider modules are activated for *google*, *github* and *microsoft*. Specific configuration options are specified for the *microsoft* provider module: @@ -43,12 +43,18 @@ In the example below, SSO provider modules are activated for *google*, *github* !!! info "Provider Module Format" Note that the provider modules specified in `social_backends` must be prefixed with `allauth.socialaccounts.providers` +!!! warning "Provider Documentation" + We do not provide any specific documentation for each provider module. Please refer to the [django-allauth documentation](https://django-allauth.readthedocs.io/en/latest/socialaccount/providers/index.html) for more information. + !!! tip "Restart Server" As the [configuration file](../start/config.md) is only read when the server is launched, ensure you restart the server after editing the file. ### Create Provider App -The next step is to create an external authentication app with your provider of choice. This step is wholly separate to your InvenTree installation, and must be performed before continuing further. +The next step is to create an external authentication app with your provider of choice. The documentation for correctly creating and configuring the provider app is not covered here. + +!!! warning "External Application" + The provider application will be created as part of your SSO provider setup. This is *not* the same as the *SocialApp* entry in the InvenTree admin interface. !!! info "Read the Documentation" The [django-allauth documentation](https://django-allauth.readthedocs.io/en/latest/socialaccount/providers/index.html) is a good starting point here. There are also a number of good tutorials online (at least for the major supported SSO providers). @@ -102,6 +108,9 @@ In any case, the URL is is specific to your installation and the SSO provider. T !!! warning "Proxy Support" If your InvenTree server is running behind a proxy, you will need to ensure that the "public facing" host address matches the internal host address of the server, and that this host address also matches the configured callback URL +!!! warning "HTTP vs HTTPS" + If your InvenTree server is running with HTTPS, the callback URL must also be HTTPS. Ensure that you have correctly configured [`LOGIN_DEFAULT_HTTP_PROTOCOL`](../start/config.md#login-options) to match your server configuration.. + ### Enable SSO Settings Now that the social application is created, you need to enable SSO authentication for the InvenTree server. diff --git a/docs/docs/start/config.md b/docs/docs/start/config.md index fc1b38d640..da4b68dea5 100644 --- a/docs/docs/start/config.md +++ b/docs/docs/start/config.md @@ -258,12 +258,9 @@ InvenTree provides allowance for additional sign-in options. The following optio ### Single Sign On -SSO backends for all required authentication providers need to be added to the config file as a list under the key `social_backends`. The correct backend-name can be found in django-allauths [configuration documentation](https://django-allauth.readthedocs.io/en/latest/installation/quickstart.html). +Single Sign On (SSO) allows users to sign in to InvenTree using a third-party authentication provider. This functionality is provided by the [django-allauth](https://docs.allauth.org/en/latest/) package. -If the selected providers need additional settings they must be added as dicts under the key `social_providers`. The correct settings can be found in the django-allauths [provider documentation](https://django-allauth.readthedocs.io/en/latest/socialaccount/providers/index.html). - -!!! warning "You are not done" - SSO still needs credentials for all providers and has to be enabled in the [global settings](../settings/global.md)! +There are multiple configuration parameters which must be specified (either in your configuration file, or via environment variables) to enable SSO functionality. Refer to the [SSO documentation](../settings/SSO.md) for a guide on SSO configuration. !!! tip "More Info" Refer to the [SSO documentation](../settings/SSO.md) for more information. @@ -274,8 +271,9 @@ The login-experience can be altered with the following settings: | Environment Variable | Configuration File | Description | Default | | --- | --- | --- | --- | -| INVENTREE_LOGIN_CONFIRM_DAYS | login.confirm_days | Duration for which confirmation links are valid | 3 | -| INVENTREE_LOGIN_ATTEMPTS | login.attempts | Count of allowed login attempts before blocking user | 5 | +| INVENTREE_LOGIN_CONFIRM_DAYS | login_confirm_days | Duration for which confirmation links are valid | 3 | +| INVENTREE_LOGIN_ATTEMPTS | login_attempts | Count of allowed login attempts before blocking user | 5 | +| INVENTREE_LOGIN_DEFAULT_HTTP_PROTOCOL | login_default_protocol | Default protocol to use for login callbacks (e.g. using [SSO](#single-sign-on)) | http | ### Authentication Backends From c5d090237907e44d3b185b50a4753f72cd041a15 Mon Sep 17 00:00:00 2001 From: Oliver Date: Sun, 21 Jan 2024 09:33:41 +1100 Subject: [PATCH 3/5] django-allauth==0.6.1 (#6301) --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 22652b35c4..cc1588b087 100644 --- a/requirements.txt +++ b/requirements.txt @@ -93,7 +93,7 @@ django==3.2.23 # djangorestframework # djangorestframework-simplejwt # drf-spectacular -django-allauth==0.59.0 +django-allauth==0.60.1 # via # -r requirements.in # django-allauth-2fa From 4b5fcd4e69582933b6875c6ccc36097ce2b1057c Mon Sep 17 00:00:00 2001 From: Oliver Date: Sun, 21 Jan 2024 22:47:47 +1100 Subject: [PATCH 4/5] 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 --- InvenTree/InvenTree/templatetags/i18n.py | 17 +- .../build/templates/build/build_base.html | 6 +- InvenTree/build/templates/build/detail.html | 4 +- .../templates/company/company_base.html | 12 +- .../templates/company/manufacturer_part.html | 2 +- .../templates/company/supplier_part.html | 6 +- .../order/templates/order/order_base.html | 4 +- .../templates/order/return_order_base.html | 4 +- .../templates/order/sales_order_base.html | 4 +- InvenTree/part/templates/part/detail.html | 6 +- InvenTree/part/templates/part/part_base.html | 22 +- .../templates/part/pricing_javascript.html | 2 +- InvenTree/stock/templates/stock/item.html | 4 +- .../stock/templates/stock/item_base.html | 12 +- InvenTree/stock/templates/stock/location.html | 8 +- InvenTree/templates/InvenTree/index.html | 46 +- .../notifications/notifications.html | 8 +- InvenTree/templates/InvenTree/search.html | 32 +- .../InvenTree/settings/settings_js.html | 8 +- .../InvenTree/settings/settings_staff_js.html | 86 ++-- .../templates/InvenTree/settings/user.html | 2 +- InvenTree/templates/js/translated/api.js | 36 +- .../templates/js/translated/attachment.js | 30 +- InvenTree/templates/js/translated/barcode.js | 74 +-- InvenTree/templates/js/translated/bom.js | 172 +++---- InvenTree/templates/js/translated/build.js | 292 ++++++------ InvenTree/templates/js/translated/company.js | 248 +++++----- InvenTree/templates/js/translated/filters.js | 30 +- InvenTree/templates/js/translated/forms.js | 42 +- InvenTree/templates/js/translated/helpers.js | 14 +- InvenTree/templates/js/translated/index.js | 10 +- InvenTree/templates/js/translated/label.js | 22 +- InvenTree/templates/js/translated/modals.js | 64 +-- .../js/translated/model_renderers.js | 14 +- InvenTree/templates/js/translated/news.js | 12 +- .../templates/js/translated/notification.js | 20 +- InvenTree/templates/js/translated/order.js | 36 +- InvenTree/templates/js/translated/part.js | 374 +++++++-------- InvenTree/templates/js/translated/plugin.js | 40 +- InvenTree/templates/js/translated/pricing.js | 78 ++-- .../templates/js/translated/purchase_order.js | 232 +++++----- InvenTree/templates/js/translated/report.js | 14 +- .../templates/js/translated/return_order.js | 98 ++-- .../templates/js/translated/sales_order.js | 270 +++++------ InvenTree/templates/js/translated/search.js | 34 +- InvenTree/templates/js/translated/stock.js | 428 +++++++++--------- .../templates/js/translated/table_filters.js | 298 ++++++------ InvenTree/templates/js/translated/tables.js | 38 +- ci/check_js_templates.py | 3 +- 49 files changed, 1654 insertions(+), 1664 deletions(-) diff --git a/InvenTree/InvenTree/templatetags/i18n.py b/InvenTree/InvenTree/templatetags/i18n.py index ceaba38625..fffaa352c2 100644 --- a/InvenTree/InvenTree/templatetags/i18n.py +++ b/InvenTree/InvenTree/templatetags/i18n.py @@ -62,7 +62,7 @@ class CustomTranslateNode(TranslateNode): @register.tag('translate') @register.tag('trans') -def do_translate(parser, token, escape=False): +def do_translate(parser, token): """Custom translation function. - Lifted from https://github.com/django/django/blob/main/django/templatetags/i18n.py. @@ -74,6 +74,7 @@ def do_translate(parser, token, escape=False): message_string = parser.compile_filter(bits[1]) remaining = bits[2:] + escape = False noop = False asvar = None message_context = None @@ -110,6 +111,8 @@ def do_translate(parser, token, escape=False): "No argument provided to the '%s' tag for the as option." % bits[0] ) asvar = value + elif option == 'escape': + escape = True else: raise TemplateSyntaxError( "Unknown argument for '%s' tag: '%s'. The only options " @@ -123,18 +126,6 @@ def do_translate(parser, token, escape=False): ) -@register.tag('jstrans') -def do_jstrans(parser, token): - """Custom translation function for javascript strings. - - - Usage: {% jstrans "String to translate" %} - - Performs the same function as the 'trans' tag, but also escapes the translated string. - - Explicitly required for javascript code within a .html template - - Note: Any {% trans %} tag is automatically escaped in a .js file - """ - return do_translate(parser, token, escape=True) - - # Re-register tags which we have not explicitly overridden register.tag('blocktrans', django.templatetags.i18n.do_block_translate) register.tag('blocktranslate', django.templatetags.i18n.do_block_translate) diff --git a/InvenTree/build/templates/build/build_base.html b/InvenTree/build/templates/build/build_base.html index e9de6bf97a..4ead85bca8 100644 --- a/InvenTree/build/templates/build/build_base.html +++ b/InvenTree/build/templates/build/build_base.html @@ -270,7 +270,7 @@ src="{% static 'img/blank_image.png' %}" '{% url "api-build-detail" build.pk %}', { method: 'DELETE', - title: '{% jstrans "Delete Build Order" %}', + title: '{% trans "Delete Build Order" escape %}', redirect: "{% url 'build-index' %}", } ); @@ -280,7 +280,7 @@ src="{% static 'img/blank_image.png' %}" $('#show-qr-code').click(function() { showQRDialog( - '{% jstrans "Build Order QR Code" %}', + '{% trans "Build Order QR Code" escape %}', '{"build": {{ build.pk }} }' ); }); @@ -292,7 +292,7 @@ src="{% static 'img/blank_image.png' %}" build: {{ build.pk }}, }, { - title: '{% jstrans "Link Barcode to Build Order" %}', + title: '{% trans "Link Barcode to Build Order" escape %}', } ); }); diff --git a/InvenTree/build/templates/build/detail.html b/InvenTree/build/templates/build/detail.html index a290ce7021..ffde5c2878 100644 --- a/InvenTree/build/templates/build/detail.html +++ b/InvenTree/build/templates/build/detail.html @@ -419,8 +419,8 @@ function allocateSelectedLines() { if (unallocated_lines.length == 0) { showAlertDialog( - '{% jstrans "Allocation Complete" %}', - '{% jstrans "All lines have been fully allocated" %}', + '{% trans "Allocation Complete" escape %}', + '{% trans "All lines have been fully allocated" escape %}', ); } else { diff --git a/InvenTree/company/templates/company/company_base.html b/InvenTree/company/templates/company/company_base.html index 70dfd364cb..87f8cf10c9 100644 --- a/InvenTree/company/templates/company/company_base.html +++ b/InvenTree/company/templates/company/company_base.html @@ -159,7 +159,7 @@ $('#company-delete').click(function() { constructForm('{% url "api-company-detail" company.pk %}', { method: 'DELETE', - title: '{% jstrans "Delete Company" %}', + title: '{% trans "Delete Company" escape %}', redirect: '{% url "company-index" %}', }); }); @@ -202,10 +202,10 @@ $('#company-image-delete').click(function(event) { event.stopPropagation(); showQuestionDialog( - '{% jstrans "Remove Image" %}', - '{% jstrans "Remove associated image from this company" %}', + '{% trans "Remove Image" escape %}', + '{% trans "Remove associated image from this company" escape %}', { - accept_text: '{% jstrans "Remove" %}', + accept_text: '{% trans "Remove" escape %}', submitClass: 'danger', accept: function() { inventreePut( @@ -234,7 +234,7 @@ fields: { image: {}, }, - title: '{% jstrans "Upload Image" %}', + title: '{% trans "Upload Image" escape %}', onSuccess: function(data) { reloadImage(data); } @@ -249,7 +249,7 @@ '{% url "api-company-detail" company.pk %}', { method: 'PATCH', - title: '{% jstrans "Download Image" %}', + title: '{% trans "Download Image" escape %}', fields: { remote_image: {}, }, diff --git a/InvenTree/company/templates/company/manufacturer_part.html b/InvenTree/company/templates/company/manufacturer_part.html index 50ad8048b2..08e6f38568 100644 --- a/InvenTree/company/templates/company/manufacturer_part.html +++ b/InvenTree/company/templates/company/manufacturer_part.html @@ -203,7 +203,7 @@ $('#parameter-create').click(function() { hidden: true, } }, - title: '{% jstrans "Add Parameter" %}', + title: '{% trans "Add Parameter" escape %}', refreshTable: '#parameter-table', }); }); diff --git a/InvenTree/company/templates/company/supplier_part.html b/InvenTree/company/templates/company/supplier_part.html index b30c55f04e..2949926cb7 100644 --- a/InvenTree/company/templates/company/supplier_part.html +++ b/InvenTree/company/templates/company/supplier_part.html @@ -273,7 +273,7 @@ src="{% static 'img/blank_image.png' %}" $("#show-qr-code").click(function() { showQRDialog( - '{% jstrans "Supplier Part QR Code" %}', + '{% trans "Supplier Part QR Code" escape %}', '{"supplierpart": {{ part.pk }} }' ); }); @@ -284,7 +284,7 @@ $("#barcode-link").click(function() { supplierpart: {{ part.pk }}, }, { - title: '{% jstrans "Link Barcode to Supplier Part" %}', + title: '{% trans "Link Barcode to Supplier Part" escape %}', } ); }); @@ -356,7 +356,7 @@ $('#update-part-availability').click(function() { fields: { available: {}, }, - title: '{% jstrans "Update Part Availability" %}', + title: '{% trans "Update Part Availability" escape %}', onSuccess: function() { location.reload(); } diff --git a/InvenTree/order/templates/order/order_base.html b/InvenTree/order/templates/order/order_base.html index fbd3dcac67..173eaeb119 100644 --- a/InvenTree/order/templates/order/order_base.html +++ b/InvenTree/order/templates/order/order_base.html @@ -315,7 +315,7 @@ $("#export-order").click(function() { $('#show-qr-code').click(function() { showQRDialog( - '{% jstrans "Purchase Order QR Code" %}', + '{% trans "Purchase Order QR Code" escape %}', '{"purchaseorder": {{ order.pk }} }' ); }); @@ -327,7 +327,7 @@ $("#barcode-link").click(function() { purchaseorder: {{ order.pk }}, }, { - title: '{% jstrans "Link Barcode to Purchase Order" %}', + title: '{% trans "Link Barcode to Purchase Order" escape %}', } ); }); diff --git a/InvenTree/order/templates/order/return_order_base.html b/InvenTree/order/templates/order/return_order_base.html index 1a5542b2d8..eb80a70d53 100644 --- a/InvenTree/order/templates/order/return_order_base.html +++ b/InvenTree/order/templates/order/return_order_base.html @@ -260,7 +260,7 @@ $('#print-order-report').click(function() { $('#show-qr-code').click(function() { showQRDialog( - '{% jstrans "Return Order QR Code" %}', + '{% trans "Return Order QR Code" escape %}', '{"returnorder": {{ order.pk }} }' ); }); @@ -272,7 +272,7 @@ $("#barcode-link").click(function() { returnorder: {{ order.pk }}, }, { - title: '{% jstrans "Link Barcode to Return Order" %}', + title: '{% trans "Link Barcode to Return Order" escape %}', } ); }); diff --git a/InvenTree/order/templates/order/sales_order_base.html b/InvenTree/order/templates/order/sales_order_base.html index 736765959e..f184d8d2bc 100644 --- a/InvenTree/order/templates/order/sales_order_base.html +++ b/InvenTree/order/templates/order/sales_order_base.html @@ -309,7 +309,7 @@ $('#print-order-report').click(function() { $('#show-qr-code').click(function() { showQRDialog( - '{% jstrans "Sales Order QR Code" %}', + '{% trans "Sales Order QR Code" escape %}', '{"salesorder": {{ order.pk }} }' ); }); @@ -321,7 +321,7 @@ $("#barcode-link").click(function() { salesorder: {{ order.pk }}, }, { - title: '{% jstrans "Link Barcode to Sales Order" %}', + title: '{% trans "Link Barcode to Sales Order" escape %}', } ); }); diff --git a/InvenTree/part/templates/part/detail.html b/InvenTree/part/templates/part/detail.html index 335527c8c6..4cf36dc387 100644 --- a/InvenTree/part/templates/part/detail.html +++ b/InvenTree/part/templates/part/detail.html @@ -656,7 +656,7 @@ value: {{ part.pk }}, }, part_2: { - label: '{% jstrans "Related Part" %}', + label: '{% trans "Related Part" escape %}', filters: { exclude_id: {{ part.pk }}, exclude_related: {{ part.pk }}, @@ -664,7 +664,7 @@ } }, focus: 'part_2', - title: '{% jstrans "Add Related Part" %}', + title: '{% trans "Add Related Part" escape %}', refreshTable: '#related-parts-table', }); }); @@ -749,7 +749,7 @@ fields: partTestTemplateFields({ part: {{ part.pk }} }), - title: '{% jstrans "Add Test Result Template" %}', + title: '{% trans "Add Test Result Template" escape %}', refreshTable: '#test-template-table', }); }); diff --git a/InvenTree/part/templates/part/part_base.html b/InvenTree/part/templates/part/part_base.html index cc71f8e19b..16ce73b291 100644 --- a/InvenTree/part/templates/part/part_base.html +++ b/InvenTree/part/templates/part/part_base.html @@ -441,7 +441,7 @@ {% if barcodes %} $("#show-qr-code").click(function() { showQRDialog( - '{% jstrans "Part QR Code" %}', + '{% trans "Part QR Code" escape %}', '{"part": {{ part.pk }} }', ); }); @@ -458,7 +458,7 @@ part: {{ part.pk }}, }, { - title: '{% jstrans "Link Barcode to Part" %}', + title: '{% trans "Link Barcode to Part" escape %}', } ); }); @@ -509,7 +509,7 @@ launchModalForm( "{% url 'part-pricing' part.id %}", { - submit_text: '{% jstrans "Calculate" %}', + submit_text: '{% trans "Calculate" escape %}', hideErrorMessage: true, } ); @@ -525,10 +525,10 @@ $('#part-image-delete').click(function(event) { event.stopPropagation(); showQuestionDialog( - '{% jstrans "Remove Image" %}', - '{% jstrans "Remove associated image from this part" %}', + '{% trans "Remove Image" escape %}', + '{% trans "Remove associated image from this part" escape %}', { - accept_text: '{% jstrans "Remove" %}', + accept_text: '{% trans "Remove" escape %}', submitClass: 'danger', accept: function() { inventreePut( @@ -557,7 +557,7 @@ fields: { image: {}, }, - title: '{% jstrans "Upload Image" %}', + title: '{% trans "Upload Image" escape %}', onSuccess: function(data) { reloadImage(data); } @@ -577,7 +577,7 @@ sidePagination: 'server', singleSelect: true, formatNoMatches: function() { - return '{% jstrans "No matching images found" %}'; + return '{% trans "No matching images found" escape %}'; }, columns: [ { @@ -611,7 +611,7 @@ '{% url "api-part-detail" part.pk %}', { method: 'PATCH', - title: '{% jstrans "Download Image" %}', + title: '{% trans "Download Image" escape %}', fields: { remote_image: {}, }, @@ -673,13 +673,13 @@ // Callback function when the "part details" panel is shown $('#collapse-part-details').on('show.bs.collapse', function() { - $('#toggle-details-button').html('{% jstrans "Hide Part Details" %}'); + $('#toggle-details-button').html('{% trans "Hide Part Details" escape %}'); inventreeSave('show-part-details', true); }); // Callback function when the "part details" panel is hidden $('#collapse-part-details').on('hide.bs.collapse', function() { - $('#toggle-details-button').html('{% jstrans "Show Part Details" %}'); + $('#toggle-details-button').html('{% trans "Show Part Details" escape %}'); inventreeSave('show-part-details', false); }); diff --git a/InvenTree/part/templates/part/pricing_javascript.html b/InvenTree/part/templates/part/pricing_javascript.html index ae3795bdcc..2bbbcd7405 100644 --- a/InvenTree/part/templates/part/pricing_javascript.html +++ b/InvenTree/part/templates/part/pricing_javascript.html @@ -21,7 +21,7 @@ $('#part-pricing-refresh').click(function() { $('#part-pricing-edit').click(function() { constructForm('{% url "api-part-pricing" part.pk %}', { - title: '{% jstrans "Update Pricing" %}', + title: '{% trans "Update Pricing" escape %}', fields: { override_min: {}, override_min_currency: {}, diff --git a/InvenTree/stock/templates/stock/item.html b/InvenTree/stock/templates/stock/item.html index 78076a1c9a..d811aa17f3 100644 --- a/InvenTree/stock/templates/stock/item.html +++ b/InvenTree/stock/templates/stock/item.html @@ -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', }); }); diff --git a/InvenTree/stock/templates/stock/item_base.html b/InvenTree/stock/templates/stock/item_base.html index aeb5287817..c0e12b172c 100644 --- a/InvenTree/stock/templates/stock/item_base.html +++ b/InvenTree/stock/templates/stock/item_base.html @@ -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, }); diff --git a/InvenTree/stock/templates/stock/location.html b/InvenTree/stock/templates/stock/location.html index f4e1c20179..bfe16dce6a 100644 --- a/InvenTree/stock/templates/stock/location.html +++ b/InvenTree/stock/templates/stock/location.html @@ -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 %}', } ); }); diff --git a/InvenTree/templates/InvenTree/index.html b/InvenTree/templates/InvenTree/index.html index 013c638e2b..4586c03508 100644 --- a/InvenTree/templates/InvenTree/index.html +++ b/InvenTree/templates/InvenTree/index.html @@ -33,10 +33,10 @@ {% to_list setting_part_starred setting_part_latest setting_bom_validation as settings_list_part %} {% if roles.part.view and True in settings_list_part %} -addHeaderTitle('{% jstrans "Parts" %}'); +addHeaderTitle('{% trans "Parts" escape %}'); {% if setting_part_starred %} -addHeaderAction('starred-parts', '{% jstrans "Subscribed Parts" %}', 'fa-bell'); +addHeaderAction('starred-parts', '{% trans "Subscribed Parts" escape %}', 'fa-bell'); loadSimplePartTable("#table-starred-parts", "{% url 'api-part-list' %}", { name: 'starred-parts', params: { @@ -49,7 +49,7 @@ loadSimplePartTable("#table-starred-parts", "{% url 'api-part-list' %}", { {% endif %} {% if setting_category_starred %} -addHeaderAction('starred-categories', '{% jstrans "Subscribed Categories" %}', 'fa-bell'); +addHeaderAction('starred-categories', '{% trans "Subscribed Categories" escape %}', 'fa-bell'); loadPartCategoryTable($('#table-starred-categories'), { params: { starred: true, @@ -59,7 +59,7 @@ loadPartCategoryTable($('#table-starred-categories'), { {% endif %} {% if setting_part_latest %} -addHeaderAction('latest-parts', '{% jstrans "Latest Parts" %}', 'fa-newspaper'); +addHeaderAction('latest-parts', '{% trans "Latest Parts" escape %}', 'fa-newspaper'); loadSimplePartTable("#table-latest-parts", "{% url 'api-part-list' %}", { name: 'latest-parts', params: { @@ -74,7 +74,7 @@ loadSimplePartTable("#table-latest-parts", "{% url 'api-part-list' %}", { {% endif %} {% if setting_bom_validation %} -addHeaderAction('bom-validation', '{% jstrans "BOM Waiting Validation" %}', 'fa-times-circle'); +addHeaderAction('bom-validation', '{% trans "BOM Waiting Validation" escape %}', 'fa-times-circle'); loadSimplePartTable("#table-bom-validation", "{% url 'api-part-list' %}", { name: 'parts-invalid-bom', params: { @@ -103,7 +103,7 @@ loadSimplePartTable("#table-bom-validation", "{% url 'api-part-list' %}", { {% if roles.stock.view %} {% if setting_stock_recent %} -addHeaderAction('recently-updated-stock', '{% jstrans "Recently Updated" %}', 'fa-clock'); +addHeaderAction('recently-updated-stock', '{% trans "Recently Updated" escape %}', 'fa-clock'); loadStockTable($('#table-recently-updated-stock'), { disableFilters: true, params: { @@ -117,7 +117,7 @@ loadStockTable($('#table-recently-updated-stock'), { {% endif %} {% if setting_stock_low %} -addHeaderAction('low-stock', '{% jstrans "Low Stock" %}', 'fa-flag'); +addHeaderAction('low-stock', '{% trans "Low Stock" escape %}', 'fa-flag'); loadSimplePartTable("#table-low-stock", "{% url 'api-part-list' %}", { name: 'parts-low-stock', params: { @@ -131,7 +131,7 @@ loadSimplePartTable("#table-low-stock", "{% url 'api-part-list' %}", { {% endif %} {% if setting_stock_depleted %} -addHeaderAction('depleted-stock', '{% jstrans "Depleted Stock" %}', 'fa-times'); +addHeaderAction('depleted-stock', '{% trans "Depleted Stock" escape %}', 'fa-times'); loadSimplePartTable("#table-depleted-stock", "{% url 'api-part-list' %}", { name: 'parts-depleted-stock', params: { @@ -145,7 +145,7 @@ loadSimplePartTable("#table-depleted-stock", "{% url 'api-part-list' %}", { {% endif %} {% if setting_stock_needed %} -addHeaderAction('stock-to-build', '{% jstrans "Required for Build Orders" %}', 'fa-bullhorn'); +addHeaderAction('stock-to-build', '{% trans "Required for Build Orders" escape %}', 'fa-bullhorn'); loadRequiredForBuildsPartsTable("#table-stock-to-build", {}); {% endif %} @@ -153,7 +153,7 @@ loadRequiredForBuildsPartsTable("#table-stock-to-build", {}); {% if expiry %} {% if setting_stock_expired %} -addHeaderAction('expired-stock', '{% jstrans "Expired Stock" %}', 'fa-calendar-times'); +addHeaderAction('expired-stock', '{% trans "Expired Stock" escape %}', 'fa-calendar-times'); loadStockTable($("#table-expired-stock"), { disableFilters: true, params: { @@ -169,7 +169,7 @@ loadStockTable($("#table-expired-stock"), { {% endif %} {% if setting_stock_stale %} -addHeaderAction('stale-stock', '{% jstrans "Stale Stock" %}', 'fa-stopwatch'); +addHeaderAction('stale-stock', '{% trans "Stale Stock" escape %}', 'fa-stopwatch'); loadStockTable($("#table-stale-stock"), { disableFilters: true, params: { @@ -193,10 +193,10 @@ loadStockTable($("#table-stale-stock"), { {% to_list setting_build_pending setting_build_overdue as settings_list_build %} {% if roles.build.view and True in settings_list_build %} -addHeaderTitle('{% jstrans "Build Orders" %}'); +addHeaderTitle('{% trans "Build Orders" escape %}'); {% if setting_build_pending %} -addHeaderAction('build-pending', '{% jstrans "Build Orders In Progress" %}', 'fa-cogs'); +addHeaderAction('build-pending', '{% trans "Build Orders In Progress" escape %}', 'fa-cogs'); loadBuildTable("#table-build-pending", { locale: '{{ request.LANGUAGE_CODE }}', params: { @@ -207,7 +207,7 @@ loadBuildTable("#table-build-pending", { {% endif %} {% if setting_build_overdue %} -addHeaderAction('build-overdue', '{% jstrans "Overdue Build Orders" %}', 'fa-calendar-times'); +addHeaderAction('build-overdue', '{% trans "Overdue Build Orders" escape %}', 'fa-calendar-times'); loadBuildTable("#table-build-overdue", { locale: '{{ request.LANGUAGE_CODE }}', params: { @@ -224,10 +224,10 @@ loadBuildTable("#table-build-overdue", { {% to_list setting_po_outstanding setting_po_overdue as settings_list_po %} {% if roles.purchase_order.view and True in settings_list_po %} -addHeaderTitle('{% jstrans "Purchase Orders" %}'); +addHeaderTitle('{% trans "Purchase Orders" escape %}'); {% if setting_po_outstanding %} -addHeaderAction('po-outstanding', '{% jstrans "Outstanding Purchase Orders" %}', 'fa-sign-in-alt'); +addHeaderAction('po-outstanding', '{% trans "Outstanding Purchase Orders" escape %}', 'fa-sign-in-alt'); loadPurchaseOrderTable("#table-po-outstanding", { url: "{% url 'api-po-list' %}", params: { @@ -238,7 +238,7 @@ loadPurchaseOrderTable("#table-po-outstanding", { {% endif %} {% if setting_po_overdue %} -addHeaderAction('po-overdue', '{% jstrans "Overdue Purchase Orders" %}', 'fa-calendar-times'); +addHeaderAction('po-overdue', '{% trans "Overdue Purchase Orders" escape %}', 'fa-calendar-times'); loadPurchaseOrderTable("#table-po-overdue", { url: "{% url 'api-po-list' %}", params: { @@ -256,10 +256,10 @@ loadPurchaseOrderTable("#table-po-overdue", { {% to_list setting_so_outstanding setting_so_overdue setting_so_shipments_pending as settings_list_so %} {% if roles.sales_order.view and True in settings_list_so %} -addHeaderTitle('{% jstrans "Sales Orders" %}'); +addHeaderTitle('{% trans "Sales Orders" escape %}'); {% if setting_so_outstanding %} -addHeaderAction('so-outstanding', '{% jstrans "Outstanding Sales Orders" %}', 'fa-sign-out-alt'); +addHeaderAction('so-outstanding', '{% trans "Outstanding Sales Orders" escape %}', 'fa-sign-out-alt'); loadSalesOrderTable("#table-so-outstanding", { url: "{% url 'api-so-list' %}", params: { @@ -270,7 +270,7 @@ loadSalesOrderTable("#table-so-outstanding", { {% endif %} {% if setting_so_overdue %} -addHeaderAction('so-overdue', '{% jstrans "Overdue Sales Orders" %}', 'fa-calendar-times'); +addHeaderAction('so-overdue', '{% trans "Overdue Sales Orders" escape %}', 'fa-calendar-times'); loadSalesOrderTable("#table-so-overdue", { url: "{% url 'api-so-list' %}", params: { @@ -281,7 +281,7 @@ loadSalesOrderTable("#table-so-overdue", { {% endif %} {% if setting_so_shipments_pending %} -addHeaderAction('so-shipments', '{% jstrans "Pending Shipments" %}', 'fa-truck-loading'); +addHeaderAction('so-shipments', '{% trans "Pending Shipments" escape %}', 'fa-truck-loading'); loadSalesOrderShipmentTable("#table-so-shipments", { url: "{% url 'api-so-shipment-list' %}", params: { @@ -296,9 +296,9 @@ loadSalesOrderShipmentTable("#table-so-shipments", { {% settings_value 'HOMEPAGE_NEWS' user=request.user as setting_news %} {% if setting_news and user.is_staff %} -addHeaderTitle('{% jstrans "InvenTree News" %}'); +addHeaderTitle('{% trans "InvenTree News" escape %}'); -addHeaderAction('news', '{% jstrans "Current News" %}', 'fa-newspaper'); +addHeaderAction('news', '{% trans "Current News" escape %}', 'fa-newspaper'); loadNewsFeedTable("#table-news", { url: "{% url 'api-news-list' %}", }); diff --git a/InvenTree/templates/InvenTree/notifications/notifications.html b/InvenTree/templates/InvenTree/notifications/notifications.html index 4ce156805d..4e0788a5ad 100644 --- a/InvenTree/templates/InvenTree/notifications/notifications.html +++ b/InvenTree/templates/InvenTree/notifications/notifications.html @@ -35,7 +35,7 @@ loadNotificationTable("#inbox-table", { params: { read: false, }, - no_matches: function() { return '{% jstrans "No unread notifications found" %}'; }, + no_matches: function() { return '{% trans "No unread notifications found" escape %}'; }, }); $("#mark-all").on('click', function() { @@ -55,7 +55,7 @@ $("#mark-all").on('click', function() { loadNotificationTable("#history-table", { name: 'history', url: '{% url 'api-notifications-list' %}', - no_matches: function() { return '{% jstrans "No notification history found" %}'; }, + no_matches: function() { return '{% trans "No notification history found" escape %}'; }, }, true); $('#history-delete').click(function() { @@ -72,7 +72,7 @@ $('#history-delete').click(function() { method: 'DELETE', multi_delete: true, preFormContent: html, - title: '{% jstrans "Delete Notifications" %}', + title: '{% trans "Delete Notifications" escape %}', refreshTable: '#history-table', form_data: { filters: { @@ -86,7 +86,7 @@ $('#history-delete').click(function() { $("#history-table").on('click', '.notification-delete', function() { constructForm(`{% url "api-notifications-list" %}${$(this).attr('pk')}/`, { method: 'DELETE', - title: '{% jstrans "Delete Notification" %}', + title: '{% trans "Delete Notification" escape %}', onSuccess: function(data) { updateNotificationTables(); } diff --git a/InvenTree/templates/InvenTree/search.html b/InvenTree/templates/InvenTree/search.html index 326e5d84c8..a295ecaf33 100644 --- a/InvenTree/templates/InvenTree/search.html +++ b/InvenTree/templates/InvenTree/search.html @@ -79,9 +79,9 @@ } {% if roles.part.view %} - addItemTitle('{% jstrans "Part" %}'); + addItemTitle('{% trans "Part" escape %}'); - addItem('part', '{% jstrans "Parts" %}', 'fa-shapes'); + addItem('part', '{% trans "Parts" escape %}', 'fa-shapes'); loadPartTable("#table-part", "{% url 'api-part-list' %}", @@ -94,7 +94,7 @@ } ); - addItem('category', '{% jstrans "Part Categories" %}', 'fa-sitemap'); + addItem('category', '{% trans "Part Categories" escape %}', 'fa-sitemap'); loadPartCategoryTable($("#table-category"), { params: { @@ -102,7 +102,7 @@ } }); - addItem('manufacturer-part', '{% jstrans "Manufacturer Parts" %}', 'fa-toolbox'); + addItem('manufacturer-part', '{% trans "Manufacturer Parts" escape %}', 'fa-toolbox'); loadManufacturerPartTable( "#table-manufacturer-part", @@ -117,7 +117,7 @@ } ); - addItem('supplier-part', '{% jstrans "Supplier Parts" %}', 'fa-pallet'); + addItem('supplier-part', '{% trans "Supplier Parts" escape %}', 'fa-pallet'); loadSupplierPartTable( "#table-supplier-part", @@ -136,9 +136,9 @@ {% if roles.build.view %} - addItemTitle('{% jstrans "Build" %}'); + addItemTitle('{% trans "Build" escape %}'); - addItem('build-order', '{% jstrans "Build Orders" %}', 'fa-tools'); + addItem('build-order', '{% trans "Build Orders" escape %}', 'fa-tools'); loadBuildTable('#table-build-order', { locale: '{{ request.LANGUAGE_CODE }}', @@ -150,9 +150,9 @@ {% endif %} {% if roles.stock.view %} - addItemTitle('{% jstrans "Stock" %}'); + addItemTitle('{% trans "Stock" escape %}'); - addItem('stock', '{% jstrans "Stock Items" %}', 'fa-boxes'); + addItem('stock', '{% trans "Stock Items" escape %}', 'fa-boxes'); loadStockTable($('#table-stock'), { filterKey: 'stocksearch', @@ -163,7 +163,7 @@ } }); - addItem('location', '{% jstrans "Stock Locations" %}', 'fa-map-marker-alt'); + addItem('location', '{% trans "Stock Locations" escape %}', 'fa-map-marker-alt'); loadStockLocationTable($("#table-location"), { filterKey: 'locationsearch', @@ -175,9 +175,9 @@ {% endif %} {% if roles.purchase_order.view or roles.sales_order.view %} - addItemTitle('{% jstrans "Company" %}'); + addItemTitle('{% trans "Company" escape %}'); - addItem('manufacturer', '{% jstrans "Manufacturers" %}', 'fa-industry'); + addItem('manufacturer', '{% trans "Manufacturers" escape %}', 'fa-industry'); loadCompanyTable('#table-manufacturer', "{% url 'api-company-list' %}", { params: { @@ -187,7 +187,7 @@ }); {% if roles.purchase_order.view %} - addItem('supplier', '{% jstrans "Suppliers" %}', 'fa-building'); + addItem('supplier', '{% trans "Suppliers" escape %}', 'fa-building'); loadCompanyTable('#table-supplier', "{% url 'api-company-list' %}", { params: { @@ -196,7 +196,7 @@ } }); - addItem('purchase-order', '{% jstrans "Purchase Orders" %}', 'fa-shopping-cart'); + addItem('purchase-order', '{% trans "Purchase Orders" escape %}', 'fa-shopping-cart'); loadPurchaseOrderTable('#table-purchase-order', { params: { @@ -207,7 +207,7 @@ {% endif %} {% if roles.sales_order.view %} - addItem('customer', '{% jstrans "Customers" %}', 'fa-user-tie'); + addItem('customer', '{% trans "Customers" escape %}', 'fa-user-tie'); loadCompanyTable('#table-customer', "{% url 'api-company-list' %}", { params: { @@ -216,7 +216,7 @@ } }); - addItem('sales-orders', '{% jstrans "Sales Orders" %}', 'fa-truck'); + addItem('sales-orders', '{% trans "Sales Orders" escape %}', 'fa-truck'); loadSalesOrderTable('#table-sales-orders', { params: { diff --git a/InvenTree/templates/InvenTree/settings/settings_js.html b/InvenTree/templates/InvenTree/settings/settings_js.html index 6aea5650e3..cbc0b56e05 100644 --- a/InvenTree/templates/InvenTree/settings/settings_js.html +++ b/InvenTree/templates/InvenTree/settings/settings_js.html @@ -55,14 +55,14 @@ $('table').find('.btn-edit-setting').click(function() { var title = ''; if (plugin != null) { - title = '{% jstrans "Edit Plugin Setting" %}'; + title = '{% trans "Edit Plugin Setting" escape %}'; } else if (notification) { - title = '{% jstrans "Edit Notification Setting" %}'; + title = '{% trans "Edit Notification Setting" escape %}'; setting = $(this).attr('pk'); } else if (is_global) { - title = '{% jstrans "Edit Global Setting" %}'; + title = '{% trans "Edit Global Setting" escape %}'; } else { - title = '{% jstrans "Edit User Setting" %}'; + title = '{% trans "Edit User Setting" escape %}'; } editSetting(setting, { diff --git a/InvenTree/templates/InvenTree/settings/settings_staff_js.html b/InvenTree/templates/InvenTree/settings/settings_staff_js.html index c762a31cc1..85d90193db 100644 --- a/InvenTree/templates/InvenTree/settings/settings_staff_js.html +++ b/InvenTree/templates/InvenTree/settings/settings_staff_js.html @@ -41,12 +41,12 @@ onPanelLoad('pricing', function() { { field: 'currency', sortable: true, - title: '{% jstrans "Currency" %}', + title: '{% trans "Currency" escape %}', }, { field: 'rate', sortable: true, - title: '{% jstrans "Rate" %}', + title: '{% trans "Rate" escape %}', } ] }); @@ -64,21 +64,21 @@ onPanelLoad('units', function() { columns: [ { field: 'name', - title: '{% jstrans "Name" %}', + title: '{% trans "Name" escape %}', }, { field: 'definition', - title: '{% jstrans "Definition" %}', + title: '{% trans "Definition" escape %}', }, { field: 'symbol', - title: '{% jstrans "Symbol" %}', + title: '{% trans "Symbol" escape %}', formatter: function(value, row) { let html = value; let buttons = ''; - buttons += makeEditButton('button-units-edit', row.pk, '{% jstrans "Edit" %}'); - buttons += makeDeleteButton('button-units-delete', row.pk, '{% jstrans "Delete" %}'); + buttons += makeEditButton('button-units-edit', row.pk, '{% trans "Edit" escape %}'); + buttons += makeDeleteButton('button-units-delete', row.pk, '{% trans "Delete" escape %}'); html += wrapButtons(buttons); return html; @@ -92,7 +92,7 @@ onPanelLoad('units', function() { let pk = $(this).attr('pk'); constructForm(`{% url "api-custom-unit-list" %}${pk}/`, { - title: '{% jstrans "Edit Custom Unit" %}', + title: '{% trans "Edit Custom Unit" escape %}', fields: { name: {}, definition: {}, @@ -107,7 +107,7 @@ onPanelLoad('units', function() { let pk = $(this).attr('pk'); constructForm(`{% url "api-custom-unit-list" %}${pk}/`, { - title: '{% jstrans "Delete Custom Unit" %}', + title: '{% trans "Delete Custom Unit" escape %}', method: 'DELETE', refreshTable: '#physical-units-table', }); @@ -121,7 +121,7 @@ onPanelLoad('units', function() { definition: {}, symbol: {}, }, - title: '{% jstrans "New Custom Unit" %}', + title: '{% trans "New Custom Unit" escape %}', method: 'POST', refreshTable: '#physical-units-table', }); @@ -137,17 +137,17 @@ onPanelLoad('project-codes', function() { search: true, sortable: true, formatNoMatches: function() { - return '{% jstrans "No project codes found" %}'; + return '{% trans "No project codes found" escape %}'; }, columns: [ { field: 'code', sortable: true, - title: '{% jstrans "Project Code" %}', + title: '{% trans "Project Code" escape %}', }, { field: 'responsible', - title: '{% jstrans "Responsible" %}', + title: '{% trans "Responsible" escape %}', formatter: function(value, row) { if (!row.responsible_detail) { return '-'; @@ -155,7 +155,7 @@ onPanelLoad('project-codes', function() { var html = row.responsible_detail.name; - if (row.responsible_detail.label == '{% jstrans "group" %}') { + if (row.responsible_detail.label == '{% trans "group" escape %}') { html += ``; } else { html += ``; @@ -167,13 +167,13 @@ onPanelLoad('project-codes', function() { { field: 'description', sortable: false, - title: '{% jstrans "Description" %}', + title: '{% trans "Description" escape %}', formatter: function(value, row) { let html = value; let buttons = ''; - buttons += makeEditButton('button-project-code-edit', row.pk, '{% jstrans "Edit Project Code" %}'); - buttons += makeDeleteButton('button-project-code-delete', row.pk, '{% jstrans "Delete Project Code" %}'); + buttons += makeEditButton('button-project-code-edit', row.pk, '{% trans "Edit Project Code" escape %}'); + buttons += makeDeleteButton('button-project-code-delete', row.pk, '{% trans "Delete Project Code" escape %}'); html += wrapButtons(buttons); return html; @@ -186,7 +186,7 @@ onPanelLoad('project-codes', function() { let pk = $(this).attr('pk'); constructForm(`{% url "api-project-code-list" %}${pk}/`, { - title: '{% jstrans "Edit Project Code" %}', + title: '{% trans "Edit Project Code" escape %}', fields: { code: {}, description: {}, @@ -200,7 +200,7 @@ onPanelLoad('project-codes', function() { let pk = $(this).attr('pk'); constructForm(`{% url "api-project-code-list" %}${pk}/`, { - title: '{% jstrans "Delete Project Code" %}', + title: '{% trans "Delete Project Code" escape %}', method: 'DELETE', refreshTable: '#project-code-table', }); @@ -213,7 +213,7 @@ onPanelLoad('project-codes', function() { code: {}, description: {}, }, - title: '{% jstrans "New Project Code" %}', + title: '{% trans "New Project Code" escape %}', method: 'POST', refreshTable: '#project-code-table', }); @@ -282,7 +282,7 @@ onPanelLoad('category', function() { }); $('#cat-param-table').inventreeTable({ - formatNoMatches: function() { return '{% jstrans "No category parameter templates found" %}'; }, + formatNoMatches: function() { return '{% trans "No category parameter templates found" escape %}'; }, columns: [ { field: 'pk', @@ -292,21 +292,21 @@ onPanelLoad('category', function() { }, { field: 'parameter_template_detail.name', - title: '{% jstrans "Parameter Template" %}', + title: '{% trans "Parameter Template" escape %}', sortable: 'true', }, { field: 'category_detail.pathstring', - title: '{% jstrans "Category" %}', + title: '{% trans "Category" escape %}', }, { field: 'default_value', - title: '{% jstrans "Default Value" %}', + title: '{% trans "Default Value" escape %}', sortable: 'true', formatter: function(value, row, index, field) { let buttons = ''; - buttons += makeEditButton('template-edit', row.pk, '{% jstrans "Edit Template" %}'); - buttons += makeDeleteButton('template-delete', row.pk, '{% jstrans "Delete Template" %}'); + buttons += makeEditButton('template-edit', row.pk, '{% trans "Edit Template" escape %}'); + buttons += makeDeleteButton('template-delete', row.pk, '{% trans "Delete Template" escape %}'); let html = value html += wrapButtons(buttons); @@ -323,7 +323,7 @@ onPanelLoad('category', function() { var pk = $(this).attr('pk'); constructForm(`/api/part/category/parameters/${pk}/`, { - title: '{% jstrans "Edit Category Parameter Template" %}', + title: '{% trans "Edit Category Parameter Template" escape %}', fields: { parameter_template: {}, category: { @@ -350,7 +350,7 @@ onPanelLoad('category', function() { constructForm(`/api/part/category/parameters/${pk}/`, { method: 'DELETE', - title: '{% jstrans "Delete Category Parameter Template" %}', + title: '{% trans "Delete Category Parameter Template" escape %}', onSuccess: function() { loadTemplateTable(pk); } @@ -385,7 +385,7 @@ onPanelLoad('category', function() { var pk = $('#category-select').val(); constructForm('{% url "api-part-category-parameter-list" %}', { - title: '{% jstrans "Create Category Parameter Template" %}', + title: '{% trans "Create Category Parameter Template" escape %}', method: 'POST', fields: { parameter_template: {}, @@ -415,7 +415,7 @@ onPanelLoad('part-parameters', function() { constructForm('{% url "api-part-parameter-template-list" %}', { fields: partParameterTemplateFields(), method: 'POST', - title: '{% jstrans "Create Part Parameter Template" %}', + title: '{% trans "Create Part Parameter Template" escape %}', refreshTable: '#param-table', }); }); @@ -437,34 +437,34 @@ onPanelLoad("stock", function() { search: true, sortable: true, formatNoMatches: function() { - return '{% jstrans "No stock location types found" %}'; + return '{% trans "No stock location types found" escape %}'; }, columns: [ { field: 'name', sortable: true, - title: '{% jstrans "Name" %}', + title: '{% trans "Name" escape %}', }, { field: 'description', sortable: false, - title: '{% jstrans "Description" %}', + title: '{% trans "Description" escape %}', }, { field: 'icon', sortable: true, - title: '{% jstrans "Icon" %}', + title: '{% trans "Icon" escape %}', }, { field: 'location_count', sortable: true, - title: '{% jstrans "Location count" %}', + title: '{% trans "Location count" escape %}', formatter: function(value, row) { let html = value; let buttons = ''; - buttons += makeEditButton('button-location-type-edit', row.pk, '{% jstrans "Edit Location Type" %}'); - buttons += makeDeleteButton('button-location-type-delete', row.pk, '{% jstrans "Delete Location type" %}'); + buttons += makeEditButton('button-location-type-edit', row.pk, '{% trans "Edit Location Type" escape %}'); + buttons += makeDeleteButton('button-location-type-delete', row.pk, '{% trans "Delete Location type" escape %}'); html += wrapButtons(buttons); return html; @@ -477,7 +477,7 @@ onPanelLoad("stock", function() { let pk = $(this).attr('pk'); constructForm(`{% url "api-location-type-list" %}${pk}/`, { - title: '{% jstrans "Edit Location Type" %}', + title: '{% trans "Edit Location Type" escape %}', fields: stockLocationTypeFields(), refreshTable: '#location-type-table', }); @@ -487,7 +487,7 @@ onPanelLoad("stock", function() { let pk = $(this).attr('pk'); constructForm(`{% url "api-location-type-list" %}${pk}/`, { - title: '{% jstrans "Delete Location Type" %}', + title: '{% trans "Delete Location Type" escape %}', method: 'DELETE', refreshTable: '#location-type-table', }); @@ -497,7 +497,7 @@ onPanelLoad("stock", function() { // Construct a new location type constructForm('{% url "api-location-type-list" %}', { fields: stockLocationTypeFields(), - title: '{% jstrans "New Location Type" %}', + title: '{% trans "New Location Type" escape %}', method: 'POST', refreshTable: '#location-type-table', }); @@ -526,18 +526,18 @@ onPanelLoad('stocktake', function() { columns: [ { field: 'report', - title: '{% jstrans "Report" %}', + title: '{% trans "Report" escape %}', formatter: function(value, row) { return attachmentLink(value); } }, { field: 'part_count', - title: '{% jstrans "Part Count" %}', + title: '{% trans "Part Count" escape %}', }, { field: 'date', - title: '{% jstrans "Date" %}', + title: '{% trans "Date" escape %}', sortable: true, formatter: function(value, row) { let html = renderDate(value); diff --git a/InvenTree/templates/InvenTree/settings/user.html b/InvenTree/templates/InvenTree/settings/user.html index 7933ad72dd..f164d2aa97 100644 --- a/InvenTree/templates/InvenTree/settings/user.html +++ b/InvenTree/templates/InvenTree/settings/user.html @@ -215,7 +215,7 @@ {% block js_ready %} (function() { -var message = "{% jstrans 'Do you really want to remove the selected email address?' %}"; +var message = '{% trans "Do you really want to remove the selected email address?" escape %}'; var actions = document.getElementsByName('action_remove'); if (actions.length) { actions[0].addEventListener("click", function(e) { diff --git a/InvenTree/templates/js/translated/api.js b/InvenTree/templates/js/translated/api.js index fb893c96e0..c9bd3dbd1a 100644 --- a/InvenTree/templates/js/translated/api.js +++ b/InvenTree/templates/js/translated/api.js @@ -222,48 +222,48 @@ function showApiError(xhr, url) { switch (xhr.status || 0) { // No response case 0: - title = '{% jstrans "No Response" %}'; - message = '{% jstrans "No response from the InvenTree server" %}'; + title = '{% trans "No Response" %}'; + message = '{% trans "No response from the InvenTree server" %}'; break; // Bad request case 400: // Note: Normally error code 400 is handled separately, // and should now be shown here! - title = '{% jstrans "Error 400: Bad request" %}'; - message = '{% jstrans "API request returned error code 400" %}'; + title = '{% trans "Error 400: Bad request" %}'; + message = '{% trans "API request returned error code 400" %}'; break; // Not authenticated case 401: - title = '{% jstrans "Error 401: Not Authenticated" %}'; - message = '{% jstrans "Authentication credentials not supplied" %}'; + title = '{% trans "Error 401: Not Authenticated" %}'; + message = '{% trans "Authentication credentials not supplied" %}'; break; // Permission denied case 403: - title = '{% jstrans "Error 403: Permission Denied" %}'; - message = '{% jstrans "You do not have the required permissions to access this function" %}'; + title = '{% trans "Error 403: Permission Denied" %}'; + message = '{% trans "You do not have the required permissions to access this function" %}'; break; // Resource not found case 404: - title = '{% jstrans "Error 404: Resource Not Found" %}'; - message = '{% jstrans "The requested resource could not be located on the server" %}'; + title = '{% trans "Error 404: Resource Not Found" %}'; + message = '{% trans "The requested resource could not be located on the server" %}'; break; // Method not allowed case 405: - title = '{% jstrans "Error 405: Method Not Allowed" %}'; - message = '{% jstrans "HTTP method not allowed at URL" %}'; + title = '{% trans "Error 405: Method Not Allowed" %}'; + message = '{% trans "HTTP method not allowed at URL" %}'; break; // Timeout case 408: - title = '{% jstrans "Error 408: Timeout" %}'; - message = '{% jstrans "Connection timeout while requesting data from server" %}'; + title = '{% trans "Error 408: Timeout" %}'; + message = '{% trans "Connection timeout while requesting data from server" %}'; break; case 503: - title = '{% jstrans "Error 503: Service Unavailable" %}'; - message = '{% jstrans "The server is currently unavailable" %}'; + title = '{% trans "Error 503: Service Unavailable" %}'; + message = '{% trans "The server is currently unavailable" %}'; break; default: - title = '{% jstrans "Unhandled Error Code" %}'; - message = `{% jstrans "Error code" %}: ${xhr.status}`; + title = '{% trans "Unhandled Error Code" %}'; + message = `{% trans "Error code" %}: ${xhr.status}`; var response = xhr.responseJSON; diff --git a/InvenTree/templates/js/translated/attachment.js b/InvenTree/templates/js/translated/attachment.js index f4d551636a..4ec0b4b625 100644 --- a/InvenTree/templates/js/translated/attachment.js +++ b/InvenTree/templates/js/translated/attachment.js @@ -45,7 +45,7 @@ function addAttachmentButtonCallbacks(url, fields={}) { fields: file_fields, method: 'POST', refreshTable: '#attachment-table', - title: '{% jstrans "Add Attachment" %}', + title: '{% trans "Add Attachment" %}', }); }); @@ -67,7 +67,7 @@ function addAttachmentButtonCallbacks(url, fields={}) { fields: link_fields, method: 'POST', refreshTable: '#attachment-table', - title: '{% jstrans "Add Link" %}', + title: '{% trans "Add Link" %}', }); }); } @@ -111,13 +111,13 @@ function deleteAttachments(attachments, url, options={}) { var html = `
- {% jstrans "All selected attachments will be deleted" %} + {% trans "All selected attachments will be deleted" %}
- - + + ${rows}
{% jstrans "Attachment" %}{% jstrans "Comment" %}{% trans "Attachment" %}{% trans "Comment" %}
@@ -126,7 +126,7 @@ function deleteAttachments(attachments, url, options={}) { constructForm(url, { method: 'DELETE', multi_delete: true, - title: '{% jstrans "Delete Attachments" %}', + title: '{% trans "Delete Attachments" %}', preFormContent: html, form_data: { items: ids, @@ -202,7 +202,7 @@ function makeAttachmentActions(permissions, options) { actions.push({ label: 'delete', icon: 'fa-trash-alt icon-red', - title: '{% jstrans "Delete attachments" %}', + title: '{% trans "Delete attachments" %}', callback: options.callback, }); } @@ -250,7 +250,7 @@ function loadAttachmentTable(url, options) { { label: 'attachments', icon: 'fa-tools', - title: '{% jstrans "Attachment actions" %}', + title: '{% trans "Attachment actions" %}', actions: makeAttachmentActions(permissions, { callback: function(attachments) { deleteAttachments(attachments, url, options); @@ -272,7 +272,7 @@ function loadAttachmentTable(url, options) { url: url, name: options.name || 'attachments', formatNoMatches: function() { - return '{% jstrans "No attachments found" %}'; + return '{% trans "No attachments found" %}'; }, sortable: true, search: true, @@ -312,7 +312,7 @@ function loadAttachmentTable(url, options) { } }, refreshTable: '#attachment-table', - title: '{% jstrans "Edit Attachment" %}', + title: '{% trans "Edit Attachment" %}', }); }); } @@ -323,7 +323,7 @@ function loadAttachmentTable(url, options) { }, { field: 'attachment', - title: '{% jstrans "Attachment" %}', + title: '{% trans "Attachment" %}', formatter: function(value, row) { if (row.attachment) { @@ -338,12 +338,12 @@ function loadAttachmentTable(url, options) { }, { field: 'comment', - title: '{% jstrans "Comment" %}', + title: '{% trans "Comment" %}', }, { field: 'upload_date', sortable: true, - title: '{% jstrans "Upload Date" %}', + title: '{% trans "Upload Date" %}', formatter: function(value, row) { var html = renderDate(value); @@ -363,7 +363,7 @@ function loadAttachmentTable(url, options) { buttons += makeEditButton( 'button-attachment-edit', row.pk, - '{% jstrans "Edit attachment" %}', + '{% trans "Edit attachment" %}', ); } @@ -371,7 +371,7 @@ function loadAttachmentTable(url, options) { buttons += makeDeleteButton( 'button-attachment-delete', row.pk, - '{% jstrans "Delete attachment" %}', + '{% trans "Delete attachment" %}', ); } diff --git a/InvenTree/templates/js/translated/barcode.js b/InvenTree/templates/js/translated/barcode.js index 966adc6a5e..e03d6f3950 100644 --- a/InvenTree/templates/js/translated/barcode.js +++ b/InvenTree/templates/js/translated/barcode.js @@ -40,23 +40,23 @@ var barcodeInputTimer = null; */ function makeBarcodeInput(placeholderText='', hintText='') { - placeholderText = placeholderText || '{% jstrans "Scan barcode data here using barcode scanner" %}'; + placeholderText = placeholderText || '{% trans "Scan barcode data here using barcode scanner" %}'; - hintText = hintText || '{% jstrans "Enter barcode data" %}'; + hintText = hintText || '{% trans "Enter barcode data" %}'; var html = `
- +
${makeIcon('fa-qrcode')} -
@@ -135,12 +135,12 @@ function onBarcodeScanCompleted(result, options) { */ function makeNotesField(options={}) { - var tooltip = options.tooltip || '{% jstrans "Enter optional notes for stock transfer" %}'; - var placeholder = options.placeholder || '{% jstrans "Enter notes" %}'; + var tooltip = options.tooltip || '{% trans "Enter optional notes for stock transfer" %}'; + var placeholder = options.placeholder || '{% trans "Enter notes" %}'; return `
- +
@@ -185,7 +185,7 @@ function postBarcodeData(barcode_data, options={}) { } else { console.error(xhr); data = xhr.responseJSON || {}; - showBarcodeMessage(modal, data.error || '{% jstrans "Server error" %}'); + showBarcodeMessage(modal, data.error || '{% trans "Server error" %}'); } break; default: @@ -214,7 +214,7 @@ function postBarcodeData(barcode_data, options={}) { } else { showBarcodeMessage( modal, - '{% jstrans "Unknown response from server" %}', + '{% trans "Unknown response from server" %}', 'warning' ); } @@ -249,7 +249,7 @@ function showBarcodeMessage(modal, message, style='danger') { function showInvalidResponseError(modal, response, status) { showBarcodeMessage( modal, - `{% jstrans "Invalid server response" %}
{% jstrans "Status" %}: '${status}'` + `{% trans "Invalid server response" %}
{% trans "Status" %}: '${status}'` ); } @@ -369,7 +369,7 @@ function barcodeDialog(title, options={}) { modalShowSubmitButton(modal, false); } - var details = options.details || '{% jstrans "Scan barcode data" %}'; + var details = options.details || '{% trans "Scan barcode data" %}'; var content = ''; @@ -417,7 +417,7 @@ function barcodeDialog(title, options={}) { function barcodeScanDialog(options={}) { let modal = options.modal || createNewModal(); - let title = options.title || '{% jstrans "Scan Barcode" %}'; + let title = options.title || '{% trans "Scan Barcode" %}'; const matching_models = [ 'build', @@ -455,7 +455,7 @@ function barcodeScanDialog(options={}) { // No match showBarcodeMessage( modal, - '{% jstrans "No URL in response" %}', + '{% trans "No URL in response" %}', 'warning' ); } @@ -493,15 +493,15 @@ function linkBarcodeDialog(data, options={}) { */ function unlinkBarcode(data, options={}) { - var html = `{% jstrans "Unlink Barcode" %}
`; + var html = `{% trans "Unlink Barcode" %}
`; - html += '{% jstrans "This will remove the link to the associated barcode" %}'; + html += '{% trans "This will remove the link to the associated barcode" %}'; showQuestionDialog( - '{% jstrans "Unlink Barcode" %}', + '{% trans "Unlink Barcode" %}', html, { - accept_text: '{% jstrans "Unlink" %}', + accept_text: '{% trans "Unlink" %}', accept: function() { inventreePut( '{% url "api-barcode-unlink" %}', @@ -543,9 +543,9 @@ function barcodeCheckInStockItems(location_id, options={}) { - - - + + + @@ -564,7 +564,7 @@ function barcodeCheckInStockItems(location_id, options={}) { - + `; }); @@ -607,12 +607,12 @@ function barcodeCheckInStockItems(location_id, options={}) { var extra = makeNotesField(); barcodeDialog( - '{% jstrans "Scan Stock Items Into Location" %}', + '{% trans "Scan Stock Items Into Location" %}', { - details: '{% jstrans "Scan stock item barcode to check in to this location" %}', + details: '{% trans "Scan stock item barcode to check in to this location" %}', headerContent: table, preShow: function() { - modalSetSubmitText(modal, '{% jstrans "Check In" %}'); + modalSetSubmitText(modal, '{% trans "Check In" %}'); modalEnable(modal, false); reloadTable(); }, @@ -644,7 +644,7 @@ function barcodeCheckInStockItems(location_id, options={}) { // Prevent submission without any entries if (entries.length == 0) { - showBarcodeMessage(modal, '{% jstrans "No barcode provided" %}', 'warning'); + showBarcodeMessage(modal, '{% trans "No barcode provided" %}', 'warning'); return; } @@ -684,18 +684,18 @@ function barcodeCheckInStockItems(location_id, options={}) { }); if (duplicate) { - showBarcodeMessage(modal, '{% jstrans "Stock Item already scanned" %}', 'warning'); + showBarcodeMessage(modal, '{% trans "Stock Item already scanned" %}', 'warning'); } else { if (stockitem.location == location_id) { - showBarcodeMessage(modal, '{% jstrans "Stock Item already in this location" %}'); + showBarcodeMessage(modal, '{% trans "Stock Item already in this location" %}'); return; } // Add this stock item to the list items.push(stockitem); - showBarcodeMessage(modal, '{% jstrans "Added stock item" %}', 'success'); + showBarcodeMessage(modal, '{% trans "Added stock item" %}', 'success'); reloadTable(); } @@ -704,7 +704,7 @@ function barcodeCheckInStockItems(location_id, options={}) { ); } else { // Barcode does not match a stock item - showBarcodeMessage(modal, '{% jstrans "Barcode does not match valid stock item" %}', 'warning'); + showBarcodeMessage(modal, '{% trans "Barcode does not match valid stock item" %}', 'warning'); } }, } @@ -723,9 +723,9 @@ function barcodeCheckInStockLocations(location_id, options={}) { var header = ''; barcodeDialog( - '{% jstrans "Scan Stock Container Into Location" %}', + '{% trans "Scan Stock Container Into Location" %}', { - details: '{% jstrans "Scan stock container barcode to check in to this location" %}', + details: '{% trans "Scan stock container barcode to check in to this location" %}', headerContent: header, preShow: function() { modalEnable(modal, false); @@ -759,7 +759,7 @@ function barcodeCheckInStockLocations(location_id, options={}) { ); } else { // Barcode does not match a valid stock location - showBarcodeMessage(modal, '{% jstrans "Barcode does not match valid stock location" %}', 'warning'); + showBarcodeMessage(modal, '{% trans "Barcode does not match valid stock location" %}', 'warning'); } } } @@ -792,7 +792,7 @@ function scanItemsIntoLocation(item_list, options={}) { if (location && location.pk) { div.html(`
- {% jstrans "Location" %}
+ {% trans "Location" %}
${location.name}
${location.description}
@@ -803,13 +803,13 @@ function scanItemsIntoLocation(item_list, options={}) { } barcodeDialog( - '{% jstrans "Check Into Location" %}', + '{% trans "Check Into Location" %}', { headerContent: header, extraFields: extra, modal: modal, preShow: function() { - modalSetSubmitText(modal, '{% jstrans "Check In" %}'); + modalSetSubmitText(modal, '{% trans "Check In" %}'); modalEnable(modal, false); }, onShow: function() { @@ -872,7 +872,7 @@ function scanItemsIntoLocation(item_list, options={}) { // Barcode does *NOT* correspond to a StockLocation showBarcodeMessage( modal, - '{% jstrans "Barcode does not match a valid location" %}', + '{% trans "Barcode does not match a valid location" %}', 'warning', ); } @@ -881,7 +881,7 @@ function scanItemsIntoLocation(item_list, options={}) { // Barcode does *NOT* correspond to a StockLocation showBarcodeMessage( modal, - '{% jstrans "Barcode does not match a valid location" %}', + '{% trans "Barcode does not match a valid location" %}', 'warning', ); } diff --git a/InvenTree/templates/js/translated/bom.js b/InvenTree/templates/js/translated/bom.js index 64a5cd0c0e..ebf1caec67 100644 --- a/InvenTree/templates/js/translated/bom.js +++ b/InvenTree/templates/js/translated/bom.js @@ -75,7 +75,7 @@ function addBomItem(part_id, options={}) { constructForm('{% url "api-bom-list" %}', { fields: fields, method: 'POST', - title: '{% jstrans "Create BOM Item" %}', + title: '{% trans "Create BOM Item" %}', focus: 'sub_part', onSuccess: function(response) { handleFormSuccess(response, options); @@ -129,8 +129,8 @@ function constructBomUploadTable(data, options={}) { let buttons = ''; - buttons += makeInfoButton('button-row-data', idx, '{% jstrans "Display row data" %}'); - buttons += makeRemoveButton('button-row-remove', idx, '{% jstrans "Remove row" %}'); + buttons += makeInfoButton('button-row-data', idx, '{% trans "Display row data" %}'); + buttons += makeRemoveButton('button-row-remove', idx, '{% trans "Remove row" %}'); buttons = wrapButtons(buttons); @@ -185,8 +185,8 @@ function constructBomUploadTable(data, options={}) { $(`#button-row-data-${idx}`).click(function() { var modal = createNewModal({ - title: '{% jstrans "Row Data" %}', - closeText: '{% jstrans "Close" %}', + title: '{% trans "Row Data" %}', + closeText: '{% trans "Close" %}', hideSubmitButton: true }); @@ -303,11 +303,11 @@ function downloadBomTemplate(options={}) { } constructFormBody({}, { - title: '{% jstrans "Download BOM Template" %}', + title: '{% trans "Download BOM Template" %}', fields: { format: { - label: '{% jstrans "Format" %}', - help_text: '{% jstrans "Select file format" %}', + label: '{% trans "Format" %}', + help_text: '{% trans "Select file format" %}', required: true, type: 'choice', value: format, @@ -337,63 +337,63 @@ function downloadBomTemplate(options={}) { function exportBom(part_id, options={}) { constructFormBody({}, { - title: '{% jstrans "Export BOM" %}', + title: '{% trans "Export BOM" %}', fields: { format: { - label: '{% jstrans "Format" %}', - help_text: '{% jstrans "Select file format" %}', + label: '{% trans "Format" %}', + help_text: '{% trans "Select file format" %}', required: true, type: 'choice', value: inventreeLoad('bom-export-format', 'csv'), choices: exportFormatOptions(), }, cascade: { - label: '{% jstrans "Multi Level BOM" %}', - help_text: '{% jstrans "Include BOM data for subassemblies" %}', + label: '{% trans "Multi Level BOM" %}', + help_text: '{% trans "Include BOM data for subassemblies" %}', type: 'boolean', value: inventreeLoad('bom-export-cascading', true), }, levels: { - label: '{% jstrans "Levels" %}', - help_text: '{% jstrans "Select maximum number of BOM levels to export (0 = all levels)" %}', + label: '{% trans "Levels" %}', + help_text: '{% trans "Select maximum number of BOM levels to export (0 = all levels)" %}', type: 'integer', value: 0, required: true, min_value: 0, }, substitute_part_data: { - label: '{% jstrans "Include Alternative Parts" %}', - help_text: '{% jstrans "Include alternative parts in exported BOM" %}', + label: '{% trans "Include Alternative Parts" %}', + help_text: '{% trans "Include alternative parts in exported BOM" %}', type: 'boolean', value: inventreeLoad('bom-export-substitute_part_data', false), }, parameter_data: { - label: '{% jstrans "Include Parameter Data" %}', - help_text: '{% jstrans "Include part parameter data in exported BOM" %}', + label: '{% trans "Include Parameter Data" %}', + help_text: '{% trans "Include part parameter data in exported BOM" %}', type: 'boolean', value: inventreeLoad('bom-export-parameter_data', false), }, stock_data: { - label: '{% jstrans "Include Stock Data" %}', - help_text: '{% jstrans "Include part stock data in exported BOM" %}', + label: '{% trans "Include Stock Data" %}', + help_text: '{% trans "Include part stock data in exported BOM" %}', type: 'boolean', value: inventreeLoad('bom-export-stock_data', false), }, manufacturer_data: { - label: '{% jstrans "Include Manufacturer Data" %}', - help_text: '{% jstrans "Include part manufacturer data in exported BOM" %}', + label: '{% trans "Include Manufacturer Data" %}', + help_text: '{% trans "Include part manufacturer data in exported BOM" %}', type: 'boolean', value: inventreeLoad('bom-export-manufacturer_data', false), }, supplier_data: { - label: '{% jstrans "Include Supplier Data" %}', - help_text: '{% jstrans "Include part supplier data in exported BOM" %}', + label: '{% trans "Include Supplier Data" %}', + help_text: '{% trans "Include part supplier data in exported BOM" %}', type: 'boolean', value: inventreeLoad('bom-export-supplier_data', false), }, pricing_data: { - label: '{% jstrans "Include Pricing Data" %}', - help_text: '{% jstrans "Include part pricing data in exported BOM" %}', + label: '{% trans "Include Pricing Data" %}', + help_text: '{% trans "Include part pricing data in exported BOM" %}', type: 'boolean', value: inventreeLoad('bom-export-pricing_data', false), } @@ -441,7 +441,7 @@ function bomItemFields() { sub_part: { icon: 'fa-shapes', secondary: { - title: '{% jstrans "New Part" %}', + title: '{% trans "New Part" %}', fields: function() { var fields = partFields(); @@ -588,7 +588,7 @@ function bomSubstitutesDialog(bom_item_id, substitutes, options={}) { var buttons = ''; - buttons += makeRemoveButton('button-row-remove', pk, '{% jstrans "Remove substitute part" %}'); + buttons += makeRemoveButton('button-row-remove', pk, '{% trans "Remove substitute part" %}'); // Render a single row var html = ` @@ -619,7 +619,7 @@ function bomSubstitutesDialog(bom_item_id, substitutes, options={}) { var html = `
- {% jstrans "Base Part" %}
+ {% trans "Base Part" %}
${part_thumb} ${part_name} - ${part_desc}
`; @@ -629,8 +629,8 @@ function bomSubstitutesDialog(bom_item_id, substitutes, options={}) {
{% jstrans "Part" %}{% jstrans "Location" %}{% jstrans "Quantity" %}{% trans "Part" %}{% trans "Location" %}{% trans "Quantity" %}
${imageHoverIcon(item.part_detail.thumbnail)} ${item.part_detail.name} ${location_info} ${item.quantity}${makeRemoveButton('button-item-remove', item.pk, '{% jstrans "Remove stock item" %}')}${makeRemoveButton('button-item-remove', item.pk, '{% trans "Remove stock item" %}')}
- - + + @@ -642,7 +642,7 @@ function bomSubstitutesDialog(bom_item_id, substitutes, options={}) { html += `
- {% jstrans "Select and add a new substitute part using the input below" %} + {% trans "Select and add a new substitute part using the input below" %}
`; @@ -653,13 +653,13 @@ function bomSubstitutesDialog(bom_item_id, substitutes, options={}) { var pre = `
- {% jstrans "Are you sure you wish to remove this substitute part link?" %} + {% trans "Are you sure you wish to remove this substitute part link?" %}
`; constructForm(`{% url "api-bom-substitute-list" %}${pk}/`, { method: 'DELETE', - title: '{% jstrans "Remove Substitute Part" %}', + title: '{% trans "Remove Substitute Part" %}', preFormContent: pre, confirm: true, onSuccess: function() { @@ -697,9 +697,9 @@ function bomSubstitutesDialog(bom_item_id, substitutes, options={}) { }, }, preFormContent: html, - closeText: '{% jstrans "Close" %}', - submitText: '{% jstrans "Add Substitute" %}', - title: '{% jstrans "Edit BOM Item Substitutes" %}', + closeText: '{% trans "Close" %}', + submitText: '{% trans "Add Substitute" %}', + title: '{% trans "Edit BOM Item Substitutes" %}', afterRender: function(fields, opts) { addRemoveCallback(opts.modal, '.button-row-remove'); }, @@ -761,14 +761,14 @@ function deleteBomItems(items, options={}) { var html = `
- {% jstrans "All selected BOM items will be deleted" %} + {% trans "All selected BOM items will be deleted" %}
{% jstrans "Part" %}{% jstrans "Description" %}{% trans "Part" %}{% trans "Description" %}
- - - + + + ${rows}
{% jstrans "Part" %}{% jstrans "Reference" %}{% jstrans "Quantity" %}{% trans "Part" %}{% trans "Reference" %}{% trans "Quantity" %}
@@ -777,7 +777,7 @@ function deleteBomItems(items, options={}) { constructForm('{% url "api-bom-list" %}', { method: 'DELETE', multi_delete: true, - title: '{% jstrans "Delete selected BOM items?" %}', + title: '{% trans "Delete selected BOM items?" %}', form_data: { items: ids, }, @@ -823,7 +823,7 @@ function loadBomTable(table, options={}) { label: 'actions', actions: [{ label: 'delete', - title: '{% jstrans "Delete items" %}', + title: '{% trans "Delete items" %}', icon: 'fa-trash-alt icon-red', permission: 'part.change', callback: function(data) { @@ -902,7 +902,7 @@ function loadBomTable(table, options={}) { cols.push( { field: 'sub_part', - title: '{% jstrans "Part" %}', + title: '{% trans "Part" %}', sortable: true, switchable: false, sorter: function(_valA, _valB, rowA, rowB) { @@ -933,7 +933,7 @@ function loadBomTable(table, options={}) { } else { html += ` - + `; } } @@ -943,11 +943,11 @@ function loadBomTable(table, options={}) { html += makePartIcons(sub_part); if (row.substitutes && row.substitutes.length > 0) { - html += makeIconBadge('fa-exchange-alt', '{% jstrans "Substitutes Available" %}'); + html += makeIconBadge('fa-exchange-alt', '{% trans "Substitutes Available" %}'); } if (row.allow_variants) { - html += makeIconBadge('fa-sitemap', '{% jstrans "Variant stock allowed" %}'); + html += makeIconBadge('fa-sitemap', '{% trans "Variant stock allowed" %}'); } return html; @@ -960,7 +960,7 @@ function loadBomTable(table, options={}) { cols.push( { field: 'sub_part_detail.description', - title: '{% jstrans "Description" %}', + title: '{% trans "Description" %}', formatter: function(value) { return withTitle(shortenString(value), value); } @@ -970,7 +970,7 @@ function loadBomTable(table, options={}) { // Part reference cols.push({ field: 'reference', - title: '{% jstrans "Reference" %}', + title: '{% trans "Reference" %}', searchable: true, sortable: true, }); @@ -978,7 +978,7 @@ function loadBomTable(table, options={}) { // Part quantity cols.push({ field: 'quantity', - title: '{% jstrans "Quantity" %}', + title: '{% trans "Quantity" %}', searchable: false, sortable: true, switchable: false, @@ -994,11 +994,11 @@ function loadBomTable(table, options={}) { } if (row.consumable) { - text += ` ({% jstrans "Consumable" %})`; + text += ` ({% trans "Consumable" %})`; } if (row.optional) { - text += ' ({% jstrans "Optional" %})'; + text += ' ({% trans "Optional" %})'; } if (row.overage) { @@ -1011,7 +1011,7 @@ function loadBomTable(table, options={}) { cols.push({ field: 'substitutes', - title: '{% jstrans "Substitutes" %}', + title: '{% trans "Substitutes" %}', searchable: false, sortable: true, formatter: function(value, row) { @@ -1025,7 +1025,7 @@ function loadBomTable(table, options={}) { cols.push({ field: 'optional', - title: '{% jstrans "Optional" %}', + title: '{% trans "Optional" %}', searchable: false, formatter: function(value) { return yesNoLabel(value); @@ -1034,7 +1034,7 @@ function loadBomTable(table, options={}) { cols.push({ field: 'consumable', - title: '{% jstrans "Consumable" %}', + title: '{% trans "Consumable" %}', searchable: false, formatter: function(value) { return yesNoLabel(value); @@ -1043,7 +1043,7 @@ function loadBomTable(table, options={}) { cols.push({ field: 'allow_variants', - title: '{% jstrans "Allow Variants" %}', + title: '{% trans "Allow Variants" %}', formatter: function(value) { return yesNoLabel(value); } @@ -1051,7 +1051,7 @@ function loadBomTable(table, options={}) { cols.push({ field: 'inherited', - title: '{% jstrans "Gets inherited" %}', + title: '{% trans "Gets inherited" %}', searchable: false, formatter: function(value, row) { // This BOM item *is* inheritable, but is defined for this BOM @@ -1068,7 +1068,7 @@ function loadBomTable(table, options={}) { cols.push({ field: 'pricing', - title: '{% jstrans "Price Range" %}', + title: '{% trans "Price Range" %}', sortable: true, sorter: function(valA, valB, rowA, rowB) { var a = rowA.pricing_min || rowA.pricing_max; @@ -1136,19 +1136,19 @@ function loadBomTable(table, options={}) { if (complete_pricing) { html += makeIconBadge( 'fa-check-circle icon-green', - '{% jstrans "BOM pricing is complete" %}', + '{% trans "BOM pricing is complete" %}', ); } else { html += makeIconBadge( 'fa-exclamation-circle icon-yellow', - '{% jstrans "BOM pricing is incomplete" %}', + '{% trans "BOM pricing is incomplete" %}', ); } return html; } else { - let html = '{% jstrans "No pricing available" %}'; + let html = '{% trans "No pricing available" %}'; html += makeIconBadge('fa-times-circle icon-red'); return html; @@ -1159,7 +1159,7 @@ function loadBomTable(table, options={}) { cols.push({ field: 'available_stock', - title: '{% jstrans "Available" %}', + title: '{% trans "Available" %}', searchable: false, sortable: true, formatter: function(value, row) { @@ -1179,16 +1179,16 @@ function loadBomTable(table, options={}) { } if (available_stock <= 0) { - text += makeIconBadge('fa-times-circle icon-red', '{% jstrans "No Stock Available" %}'); + text += makeIconBadge('fa-times-circle icon-red', '{% trans "No Stock Available" %}'); } else { var extra = ''; if ((substitute_stock > 0) && (variant_stock > 0)) { - extra = '{% jstrans "Includes variant and substitute stock" %}'; + extra = '{% trans "Includes variant and substitute stock" %}'; } else if (variant_stock > 0) { - extra = '{% jstrans "Includes variant stock" %}'; + extra = '{% trans "Includes variant stock" %}'; } else if (substitute_stock > 0) { - extra = '{% jstrans "Includes substitute stock" %}'; + extra = '{% trans "Includes substitute stock" %}'; } if (extra) { @@ -1199,7 +1199,7 @@ function loadBomTable(table, options={}) { if (row.on_order && row.on_order > 0) { text += makeIconBadge( 'fa-shopping-cart', - `{% jstrans "On Order" %}: ${row.on_order}`, + `{% trans "On Order" %}: ${row.on_order}`, ); } @@ -1210,13 +1210,13 @@ function loadBomTable(table, options={}) { cols.push( { field: 'can_build', - title: '{% jstrans "Can Build" %}', + title: '{% trans "Can Build" %}', sortable: true, formatter: function(value, row) { // "Consumable" parts are not tracked in the build if (row.consumable) { - return `{% jstrans "Consumable item" %}`; + return `{% trans "Consumable item" %}`; } var can_build = canBuildQuantity(row); @@ -1256,7 +1256,7 @@ function loadBomTable(table, options={}) { cols.push( { field: 'note', - title: '{% jstrans "Notes" %}', + title: '{% trans "Notes" %}', searchable: true, sortable: true, formatter: function(value) { @@ -1268,7 +1268,7 @@ function loadBomTable(table, options={}) { if (options.editable) { cols.push({ - title: '{% jstrans "Actions" %}', + title: '{% trans "Actions" %}', switchable: false, field: 'pk', visible: true, @@ -1276,15 +1276,15 @@ function loadBomTable(table, options={}) { if (row.part == options.parent_id) { - var bValidate = makeIconButton('fa-check-circle icon-green', 'bom-validate-button', row.pk, '{% jstrans "Validate BOM Item" %}'); + var bValidate = makeIconButton('fa-check-circle icon-green', 'bom-validate-button', row.pk, '{% trans "Validate BOM Item" %}'); - var bValid = makeIconButton('fa-check-double icon-green', 'bom-valid-button', row.pk, '{% jstrans "This line has been validated" %}', {disabled: true}); + var bValid = makeIconButton('fa-check-double icon-green', 'bom-valid-button', row.pk, '{% trans "This line has been validated" %}', {disabled: true}); - var bSubs = makeIconButton('fa-exchange-alt icon-blue', 'bom-substitutes-button', row.pk, '{% jstrans "Edit substitute parts" %}'); + var bSubs = makeIconButton('fa-exchange-alt icon-blue', 'bom-substitutes-button', row.pk, '{% trans "Edit substitute parts" %}'); - var bEdit = makeEditButton('bom-edit-button', row.pk, '{% jstrans "Edit BOM Item" %}'); + var bEdit = makeEditButton('bom-edit-button', row.pk, '{% trans "Edit BOM Item" %}'); - var bDelt = makeDeleteButton('bom-delete-button', row.pk, '{% jstrans "Delete BOM Item" %}'); + var bDelt = makeDeleteButton('bom-delete-button', row.pk, '{% trans "Delete BOM Item" %}'); let buttons = ''; @@ -1304,15 +1304,15 @@ function loadBomTable(table, options={}) { // Return a link to the external BOM return renderLink( - '{% jstrans "View BOM" %}', + '{% trans "View BOM" %}', `/part/${row.part}/bom/` ); } }, footerFormatter: function(data) { return ` - `; } @@ -1388,7 +1388,7 @@ function loadBomTable(table, options={}) { }, formatNoMatches: function() { - return '{% jstrans "No BOM items found" %}'; + return '{% trans "No BOM items found" %}'; }, queryParams: filters, original: params, @@ -1477,7 +1477,7 @@ function loadBomTable(table, options={}) { constructForm(`{% url "api-bom-list" %}${pk}/`, { fields: fields, - title: '{% jstrans "Edit BOM Item" %}', + title: '{% trans "Edit BOM Item" %}', focus: 'sub_part', onSuccess: function() { reloadBomTable(table); @@ -1630,7 +1630,7 @@ function loadUsedInTable(table, part_id, options={}) { }, { field: 'part', - title: '{% jstrans "Assembly" %}', + title: '{% trans "Assembly" %}', switchable: false, sortable: true, formatter: function(value, row) { @@ -1648,7 +1648,7 @@ function loadUsedInTable(table, part_id, options={}) { }, { field: 'sub_part', - title: '{% jstrans "Required Part" %}', + title: '{% trans "Required Part" %}', sortable: true, formatter: function(value, row) { var url = `/part/${value}/`; @@ -1665,7 +1665,7 @@ function loadUsedInTable(table, part_id, options={}) { }, { field: 'quantity', - title: '{% jstrans "Required Quantity" %}', + title: '{% trans "Required Quantity" %}', formatter: function(value, row) { var html = value; @@ -1674,7 +1674,7 @@ function loadUsedInTable(table, part_id, options={}) { } if (row.parent && row.parent != 'top-level-item') { - html += ` ({% jstrans "Inherited from parent BOM" %})`; + html += ` ({% trans "Inherited from parent BOM" %})`; } return html; diff --git a/InvenTree/templates/js/translated/build.js b/InvenTree/templates/js/translated/build.js index fce8d0ea57..b0caeef764 100644 --- a/InvenTree/templates/js/translated/build.js +++ b/InvenTree/templates/js/translated/build.js @@ -139,7 +139,7 @@ function editBuildOrder(pk) { constructForm(`{% url "api-build-list" %}${pk}/`, { fields: fields, reload: true, - title: '{% jstrans "Edit Build Order" %}', + title: '{% trans "Edit Build Order" %}', }); } @@ -182,7 +182,7 @@ function newBuildOrder(options={}) { data: options.data, follow: true, method: 'POST', - title: '{% jstrans "Create Build Order" %}', + title: '{% trans "Create Build Order" %}', onSuccess: options.onSuccess, }); } @@ -214,7 +214,7 @@ function cancelBuildOrder(build_id, options={}) { `{% url "api-build-list" %}${build_id}/cancel/`, { method: 'POST', - title: '{% jstrans "Cancel Build Order" %}', + title: '{% trans "Cancel Build Order" %}', confirm: true, fields: { remove_allocated_stock: {}, @@ -223,20 +223,20 @@ function cancelBuildOrder(build_id, options={}) { preFormContent: function(opts) { var html = `
- {% jstrans "Are you sure you wish to cancel this build?" %} + {% trans "Are you sure you wish to cancel this build?" %}
`; if (opts.context.has_allocated_stock) { html += `
- {% jstrans "Stock items have been allocated to this build order" %} + {% trans "Stock items have been allocated to this build order" %}
`; } if (opts.context.incomplete_outputs) { html += `
- {% jstrans "There are incomplete outputs remaining for this build order" %} + {% trans "There are incomplete outputs remaining for this build order" %}
`; } @@ -288,30 +288,30 @@ function completeBuildOrder(build_id, options={}) { if (ctx.allocated && ctx.remaining == 0 && ctx.incomplete == 0) { html += `
- {% jstrans "Build order is ready to be completed" %}' + {% trans "Build order is ready to be completed" %}'
`; } else { if (ctx.incomplete > 0) { html += `
- {% jstrans "Build order has incomplete outputs" %}
- {% jstrans "This build order cannot be completed as there are incomplete outputs" %} + {% trans "Build order has incomplete outputs" %}
+ {% trans "This build order cannot be completed as there are incomplete outputs" %}
`; } else { html += `
- {% jstrans "Build Order is incomplete" %} + {% trans "Build Order is incomplete" %}
`; } if (!ctx.allocated) { - html += `
{% jstrans "Required stock has not been fully allocated" %}
`; + html += `
{% trans "Required stock has not been fully allocated" %}
`; } if (ctx.remaining > 0) { - html += `
{% jstrans "Required build quantity has not been completed" %}
`; + html += `
{% trans "Required build quantity has not been completed" %}
`; } } @@ -319,7 +319,7 @@ function completeBuildOrder(build_id, options={}) { }, reload: true, confirm: true, - title: '{% jstrans "Complete Build Order" %}', + title: '{% trans "Complete Build Order" %}', method: 'POST', }); } @@ -360,9 +360,9 @@ function createBuildOutput(build_id, options) { inventreeGet(`{% url "api-part-list" %}${build.part}/serial-numbers/`, {}, { success: function(data) { if (data.next) { - fields.serial_numbers.placeholder = `{% jstrans "Next available serial number" %}: ${data.next}`; + fields.serial_numbers.placeholder = `{% trans "Next available serial number" %}: ${data.next}`; } else if (data.latest) { - fields.serial_numbers.placeholder = `{% jstrans "Latest serial number" %}: ${data.latest}`; + fields.serial_numbers.placeholder = `{% trans "Latest serial number" %}: ${data.latest}`; } }, async: false, @@ -371,8 +371,8 @@ function createBuildOutput(build_id, options) { if (options.trackable_parts) { html += `
- {% jstrans "The Bill of Materials contains trackable parts" %}.
- {% jstrans "Build outputs must be generated individually" %}. + {% trans "The Bill of Materials contains trackable parts" %}.
+ {% trans "Build outputs must be generated individually" %}.
`; } @@ -380,15 +380,15 @@ function createBuildOutput(build_id, options) { if (trackable) { html += `
- {% jstrans "Trackable parts can have serial numbers specified" %}
- {% jstrans "Enter serial numbers to generate multiple single build outputs" %} + {% trans "Trackable parts can have serial numbers specified" %}
+ {% trans "Enter serial numbers to generate multiple single build outputs" %}
`; } constructForm(`{% url "api-build-list" %}${build_id}/create-output/`, { method: 'POST', - title: '{% jstrans "Create Build Output" %}', + title: '{% trans "Create Build Output" %}', confirm: true, fields: fields, preFormContent: html, @@ -419,7 +419,7 @@ function makeBuildOutputButtons(output_id, build_info, options={}) { 'fa-sign-in-alt icon-blue', 'button-output-allocate', output_id, - '{% jstrans "Allocate stock items to this build output" %}', + '{% trans "Allocate stock items to this build output" %}', ); // Add a button to deallocate stock from this build output @@ -427,7 +427,7 @@ function makeBuildOutputButtons(output_id, build_info, options={}) { 'fa-minus-circle icon-red', 'button-output-deallocate', output_id, - '{% jstrans "Deallocate stock from build output" %}', + '{% trans "Deallocate stock from build output" %}', ); } @@ -436,7 +436,7 @@ function makeBuildOutputButtons(output_id, build_info, options={}) { 'fa-check-circle icon-green', 'button-output-complete', output_id, - '{% jstrans "Complete build output" %}', + '{% trans "Complete build output" %}', ); // Add a button to "scrap" the build output @@ -444,14 +444,14 @@ function makeBuildOutputButtons(output_id, build_info, options={}) { 'fa-times-circle icon-red', 'button-output-scrap', output_id, - '{% jstrans "Scrap build output" %}', + '{% trans "Scrap build output" %}', ); // Add a button to "remove" this build output html += makeDeleteButton( 'button-output-remove', output_id, - '{% jstrans "Delete build output" %}', + '{% trans "Delete build output" %}', ); return wrapButtons(html); @@ -471,7 +471,7 @@ function deallocateStock(build_id, options={}) { var html = `
- {% jstrans "Are you sure you wish to deallocate the selected stock items from this build?" %} + {% trans "Are you sure you wish to deallocate the selected stock items from this build?" %} `; @@ -489,7 +489,7 @@ function deallocateStock(build_id, options={}) { value: options.build_line, }, }, - title: '{% jstrans "Deallocate Stock Items" %}', + title: '{% trans "Deallocate Stock Items" %}', onSuccess: function(response, opts) { if (options.onSuccess) { options.onSuccess(response, opts); @@ -511,9 +511,9 @@ function renderBuildOutput(output, options={}) { let output_html = imageHoverIcon(output.part_detail.thumbnail); if (output.quantity == 1 && output.serial) { - output_html += `{% jstrans "Serial Number" %}: ${output.serial}`; + output_html += `{% trans "Serial Number" %}: ${output.serial}`; } else { - output_html += `{% jstrans "Quantity" %}: ${output.quantity}`; + output_html += `{% trans "Quantity" %}: ${output.quantity}`; if (output.part_detail && output.part_detail.units) { output_html += ` ${output.part_detail.units} `; } @@ -521,7 +521,7 @@ function renderBuildOutput(output, options={}) { let buttons = `
`; - buttons += makeRemoveButton('button-row-remove', pk, '{% jstrans "Remove row" %}'); + buttons += makeRemoveButton('button-row-remove', pk, '{% trans "Remove row" %}'); buttons += '
'; @@ -575,8 +575,8 @@ function completeBuildOutputs(build_id, outputs, options={}) { if (outputs.length == 0) { showAlertDialog( - '{% jstrans "Select Build Outputs" %}', - '{% jstrans "At least one build output must be selected" %}', + '{% trans "Select Build Outputs" %}', + '{% trans "At least one build output must be selected" %}', ); return; } @@ -590,11 +590,11 @@ function completeBuildOutputs(build_id, outputs, options={}) { var html = `
- {% jstrans "Selected build outputs will be marked as complete" %} + {% trans "Selected build outputs will be marked as complete" %}
- + @@ -622,7 +622,7 @@ function completeBuildOutputs(build_id, outputs, options={}) { accept_incomplete_allocation: {}, }, confirm: true, - title: '{% jstrans "Complete Build Outputs" %}', + title: '{% trans "Complete Build Outputs" %}', afterRender: function(fields, opts) { // Setup callbacks to remove outputs $(opts.modal).find('.button-row-remove').click(function() { @@ -703,8 +703,8 @@ function scrapBuildOutputs(build_id, outputs, options={}) { if (outputs.length == 0) { showAlertDialog( - '{% jstrans "Select Build Outputs" %}', - '{% jstrans "At least one build output must be selected" %}', + '{% trans "Select Build Outputs" %}', + '{% trans "At least one build output must be selected" %}', ); return; } @@ -719,17 +719,17 @@ function scrapBuildOutputs(build_id, outputs, options={}) { var html = `
- {% jstrans "Selected build outputs will be marked as scrapped" %} + {% trans "Selected build outputs will be marked as scrapped" %}
    -
  • {% jstrans "Scrapped output are marked as rejected" %}
  • -
  • {% jstrans "Allocated stock items will no longer be available" %}
  • -
  • {% jstrans "The completion status of the build order will not be adjusted" %}
  • +
  • {% trans "Scrapped output are marked as rejected" %}
  • +
  • {% trans "Allocated stock items will no longer be available" %}
  • +
  • {% trans "The completion status of the build order will not be adjusted" %}
{% jstrans "Output" %}{% trans "Output" %}
- - + + @@ -754,7 +754,7 @@ function scrapBuildOutputs(build_id, outputs, options={}) { discard_allocations: {}, }, confirm: true, - title: '{% jstrans "Scrap Build Outputs" %}', + title: '{% trans "Scrap Build Outputs" %}', afterRender: function(fields, opts) { // Setup callbacks to remove outputs $(opts.modal).find('.button-row-remove').click(function() { @@ -829,8 +829,8 @@ function deleteBuildOutputs(build_id, outputs, options={}) { if (outputs.length == 0) { showAlertDialog( - '{% jstrans "Select Build Outputs" %}', - '{% jstrans "At least one build output must be selected" %}', + '{% trans "Select Build Outputs" %}', + '{% trans "At least one build output must be selected" %}', ); return; } @@ -844,15 +844,15 @@ function deleteBuildOutputs(build_id, outputs, options={}) { var html = `
- {% jstrans "Selected build outputs will be deleted" %} + {% trans "Selected build outputs will be deleted" %}
    -
  • {% jstrans "Build output data will be permanently deleted" %}
  • -
  • {% jstrans "Allocated stock items will be returned to stock" %}
  • +
  • {% trans "Build output data will be permanently deleted" %}
  • +
  • {% trans "Allocated stock items will be returned to stock" %}
{% jstrans "Output" %}{% jstrans "Quantity" %}{% trans "Output" %}{% trans "Quantity" %}
- + @@ -865,7 +865,7 @@ function deleteBuildOutputs(build_id, outputs, options={}) { preFormContent: html, fields: {}, confirm: true, - title: '{% jstrans "Delete Build Outputs" %}', + title: '{% trans "Delete Build Outputs" %}', afterRender: function(fields, opts) { // Setup callbacks to remove outputs $(opts.modal).find('.button-row-remove').click(function() { @@ -952,7 +952,7 @@ function loadBuildOrderAllocationTable(table, options={}) { paginationVAlign: 'bottom', original: options.params, formatNoMatches: function() { - return '{% jstrans "No build order allocations found" %}'; + return '{% trans "No build order allocations found" %}'; }, columns: [ { @@ -964,7 +964,7 @@ function loadBuildOrderAllocationTable(table, options={}) { field: 'build', sortable: true, switchable: false, - title: '{% jstrans "Build Order" %}', + title: '{% trans "Build Order" %}', formatter: function(value, row) { let ref = `${row.build_detail.reference}`; let html = renderLink(ref, `/build/${row.build}/`); @@ -981,7 +981,7 @@ function loadBuildOrderAllocationTable(table, options={}) { { field: 'quantity', sortable: true, - title: '{% jstrans "Allocated Quantity" %}', + title: '{% trans "Allocated Quantity" %}', formatter: function(value, row) { let link = `/stock/item/${row.stock_item}/`; let text = formatDecimal(value); @@ -991,11 +991,11 @@ function loadBuildOrderAllocationTable(table, options={}) { }, { field: 'location_detail', - title: '{% jstrans "Location" %}', + title: '{% trans "Location" %}', formatter: function(value, row) { if (!value) { - return '{% jstrans "Location not specified" %}'; + return '{% trans "Location not specified" %}'; } let item = row.stock_item_detail; @@ -1017,7 +1017,7 @@ function makeBuildOutputActions(build_info) { return [ { label: 'complete', - title: '{% jstrans "Complete outputs" %}', + title: '{% trans "Complete outputs" %}', icon: 'fa-check-circle icon-green', permission: 'build.add', callback: function(data) { @@ -1035,7 +1035,7 @@ function makeBuildOutputActions(build_info) { }, { label: 'scrap', - title: '{% jstrans "Scrap outputs" %}', + title: '{% trans "Scrap outputs" %}', icon: 'fa-times-circle icon-red', permission: 'build.change', callback: function(data) { @@ -1053,7 +1053,7 @@ function makeBuildOutputActions(build_info) { }, { label: 'delete', - title: '{% jstrans "Delete outputs" %}', + title: '{% trans "Delete outputs" %}', icon: 'fa-trash-alt icon-red', permission: 'build.delete', callback: function(data) { @@ -1107,12 +1107,12 @@ function loadBuildOutputTable(build_info, options={}) { url: '{% url "api-stockitem-label-list" %}', key: 'item', }, - singular_name: '{% jstrans "build output" %}', - plural_name: '{% jstrans "build outputs" %}', + singular_name: '{% trans "build output" %}', + plural_name: '{% trans "build outputs" %}', custom_actions: [{ label: 'buildoutput', icon: 'fa-tools', - title: '{% jstrans "Build output actions" %}', + title: '{% trans "Build output actions" %}', actions: makeBuildOutputActions(build_info), }] }); @@ -1281,7 +1281,7 @@ function loadBuildOutputTable(build_info, options={}) { return constructOutputSubTable(index, row, element); }, formatNoMatches: function() { - return '{% jstrans "No active build outputs found" %}'; + return '{% trans "No active build outputs found" %}'; }, onLoadSuccess: function() { reloadOutputAllocations(); @@ -1296,7 +1296,7 @@ function loadBuildOutputTable(build_info, options={}) { }, { field: 'part', - title: '{% jstrans "Part" %}', + title: '{% trans "Part" %}', switchable: false, formatter: function(value, row) { return imageHoverIcon(row.part_detail.thumbnail) + @@ -1306,7 +1306,7 @@ function loadBuildOutputTable(build_info, options={}) { }, { field: 'quantity', - title: '{% jstrans "Build Output" %}', + title: '{% trans "Build Output" %}', switchable: false, sortable: true, sorter: function(fieldA, fieldB, rowA, rowB) { @@ -1351,9 +1351,9 @@ function loadBuildOutputTable(build_info, options={}) { let text = ''; if (row.serial && row.quantity == 1) { - text = `{% jstrans "Serial Number" %}: ${row.serial}`; + text = `{% trans "Serial Number" %}: ${row.serial}`; } else { - text = `{% jstrans "Quantity" %}: ${row.quantity}`; + text = `{% trans "Quantity" %}: ${row.quantity}`; } @@ -1364,7 +1364,7 @@ function loadBuildOutputTable(build_info, options={}) { } if (row.batch) { - text += ` ({% jstrans "Batch" %}: ${row.batch})`; + text += ` ({% trans "Batch" %}: ${row.batch})`; } text += stockStatusDisplay(row.status, {classes: 'float-right'}); @@ -1374,7 +1374,7 @@ function loadBuildOutputTable(build_info, options={}) { }, { field: 'fully_allocated', - title: '{% jstrans "Allocated Lines" %}', + title: '{% trans "Allocated Lines" %}', visible: false, sortable: true, switchable: false, @@ -1388,7 +1388,7 @@ function loadBuildOutputTable(build_info, options={}) { }, { field: 'tests', - title: '{% jstrans "Required Tests" %}', + title: '{% trans "Required Tests" %}', visible: test_templates.length > 0, switchable: true, sortable: true, @@ -1560,8 +1560,8 @@ function allocateStockToBuild(build_id, line_items, options={}) { if (line_items.length == 0) { showAlertDialog( - '{% jstrans "Select Parts" %}', - '{% jstrans "You must select at least one part to allocate" %}', + '{% trans "Select Parts" %}', + '{% trans "You must select at least one part to allocate" %}', ); return; @@ -1613,7 +1613,7 @@ function allocateStockToBuild(build_id, line_items, options={}) { delete_button += makeRemoveButton( 'button-row-remove', pk, - '{% jstrans "Remove row" %}', + '{% trans "Remove row" %}', ); delete_button += ``; @@ -1624,7 +1624,7 @@ function allocateStockToBuild(build_id, line_items, options={}) { type: 'decimal', min_value: 0, value: quantity || 0, - title: '{% jstrans "Specify stock allocation quantity" %}', + title: '{% trans "Specify stock allocation quantity" %}', required: true, }, { @@ -1701,8 +1701,8 @@ function allocateStockToBuild(build_id, line_items, options={}) { if (table_entries.length == 0) { showAlertDialog( - '{% jstrans "All Parts Allocated" %}', - '{% jstrans "All selected parts have been fully allocated" %}', + '{% trans "All Parts Allocated" %}', + '{% trans "All selected parts have been fully allocated" %}', ); return; @@ -1715,8 +1715,8 @@ function allocateStockToBuild(build_id, line_items, options={}) { 'take_from', { type: 'related field', - label: '{% jstrans "Source Location" %}', - help_text: '{% jstrans "Select source location (leave blank to take from all locations)" %}', + label: '{% trans "Source Location" %}', + help_text: '{% trans "Select source location (leave blank to take from all locations)" %}', required: false, }, {}, @@ -1727,10 +1727,10 @@ function allocateStockToBuild(build_id, line_items, options={}) {
{% jstrans "Output" %}{% trans "Output" %}
- - - - + + + + @@ -1744,7 +1744,7 @@ function allocateStockToBuild(build_id, line_items, options={}) { method: 'POST', fields: {}, preFormContent: html, - title: '{% jstrans "Allocate Stock Items to Build Order" %}', + title: '{% trans "Allocate Stock Items to Build Order" %}', afterRender: function(fields, options) { var take_from_field = { @@ -1755,7 +1755,7 @@ function allocateStockToBuild(build_id, line_items, options={}) { type: 'related field', value: source_location, noResults: function(query) { - return '{% jstrans "No matching stock locations" %}'; + return '{% trans "No matching stock locations" %}'; }, }; @@ -1828,7 +1828,7 @@ function allocateStockToBuild(build_id, line_items, options={}) { return filters; }, noResults: function(query) { - return '{% jstrans "No matching stock items" %}'; + return '{% trans "No matching stock items" %}'; } }, null, @@ -1925,12 +1925,12 @@ function autoAllocateStockToBuild(build_id, bom_items=[], options={}) { var html = `
- {% jstrans "Automatic Stock Allocation" %}
- {% jstrans "Stock items will be automatically allocated to this build order, according to the provided guidelines" %}: + {% trans "Automatic Stock Allocation" %}
+ {% trans "Stock items will be automatically allocated to this build order, according to the provided guidelines" %}:
    -
  • {% jstrans "If a location is specified, stock will only be allocated from that location" %}
  • -
  • {% jstrans "If stock is considered interchangeable, it will be allocated from the first location it is found" %}
  • -
  • {% jstrans "If substitute stock is allowed, it will be used where stock of the primary part cannot be found" %}
  • +
  • {% trans "If a location is specified, stock will only be allocated from that location" %}
  • +
  • {% trans "If stock is considered interchangeable, it will be allocated from the first location it is found" %}
  • +
  • {% trans "If substitute stock is allowed, it will be used where stock of the primary part cannot be found" %}
`; @@ -1961,7 +1961,7 @@ function autoAllocateStockToBuild(build_id, bom_items=[], options={}) { constructForm(`{% url "api-build-list" %}${build_id}/auto-allocate/`, { method: 'POST', fields: fields, - title: '{% jstrans "Allocate Stock Items" %}', + title: '{% trans "Allocate Stock Items" %}', confirm: true, preFormContent: html, onSuccess: function(response) { @@ -2067,7 +2067,7 @@ function loadBuildTable(table, options) { $(table).inventreeTable({ method: 'get', formatNoMatches: function() { - return '{% jstrans "No builds matching query" %}'; + return '{% trans "No builds matching query" %}'; }, url: '{% url "api-build-list" %}', queryParams: filters, @@ -2102,13 +2102,13 @@ function loadBuildTable(table, options) { }, { checkbox: true, - title: '{% jstrans "Select" %}', + title: '{% trans "Select" %}', searchable: false, switchable: false, }, { field: 'reference', - title: '{% jstrans "Build" %}', + title: '{% trans "Build" %}', sortable: true, switchable: true, formatter: function(value, row) { @@ -2116,7 +2116,7 @@ function loadBuildTable(table, options) { var html = renderLink(value, '/build/' + row.pk + '/'); if (row.overdue) { - html += makeIconBadge('fa-calendar-times icon-red', '{% jstrans "Build order is overdue" %}'); + html += makeIconBadge('fa-calendar-times icon-red', '{% trans "Build order is overdue" %}'); } return html; @@ -2124,12 +2124,12 @@ function loadBuildTable(table, options) { }, { field: 'title', - title: '{% jstrans "Description" %}', + title: '{% trans "Description" %}', switchable: true, }, { field: 'project_code', - title: '{% jstrans "Project Code" %}', + title: '{% trans "Project Code" %}', sortable: true, switchable: global_settings.PROJECT_CODES_ENABLED, visible: global_settings.PROJECT_CODES_ENABLED, @@ -2141,13 +2141,13 @@ function loadBuildTable(table, options) { }, { field: 'priority', - title: '{% jstrans "Priority" %}', + title: '{% trans "Priority" %}', switchable: true, sortable: true, }, { field: 'part', - title: '{% jstrans "Part" %}', + title: '{% trans "Part" %}', sortable: true, sortName: 'part__name', formatter: function(value, row) { @@ -2162,7 +2162,7 @@ function loadBuildTable(table, options) { }, { field: 'completed', - title: '{% jstrans "Progress" %}', + title: '{% trans "Progress" %}', sortable: true, formatter: function(value, row) { return makeProgressBar( @@ -2176,7 +2176,7 @@ function loadBuildTable(table, options) { }, { field: 'status', - title: '{% jstrans "Status" %}', + title: '{% trans "Status" %}', sortable: true, formatter: function(value) { return buildStatusDisplay(value); @@ -2184,7 +2184,7 @@ function loadBuildTable(table, options) { }, { field: 'creation_date', - title: '{% jstrans "Created" %}', + title: '{% trans "Created" %}', sortable: true, formatter: function(value) { return renderDate(value); @@ -2192,19 +2192,19 @@ function loadBuildTable(table, options) { }, { field: 'issued_by', - title: '{% jstrans "Issued by" %}', + title: '{% trans "Issued by" %}', sortable: true, formatter: function(value, row) { if (value) { return row.issued_by_detail.username; } else { - return `{% jstrans "No user information" %}`; + return `{% trans "No user information" %}`; } } }, { field: 'responsible', - title: '{% jstrans "Responsible" %}', + title: '{% trans "Responsible" %}', sortable: true, formatter: function(value, row) { if (!row.responsible_detail) { @@ -2213,7 +2213,7 @@ function loadBuildTable(table, options) { var html = row.responsible_detail.name; - if (row.responsible_detail.label == '{% jstrans "group" %}') { + if (row.responsible_detail.label == '{% trans "group" %}') { html += ``; } else { html += ``; @@ -2224,7 +2224,7 @@ function loadBuildTable(table, options) { }, { field: 'target_date', - title: '{% jstrans "Target Date" %}', + title: '{% trans "Target Date" %}', sortable: true, formatter: function(value) { return renderDate(value); @@ -2232,7 +2232,7 @@ function loadBuildTable(table, options) { }, { field: 'completion_date', - title: '{% jstrans "Completion Date" %}', + title: '{% trans "Completion Date" %}', sortable: true, formatter: function(value) { return renderDate(value); @@ -2320,7 +2320,7 @@ function renderBuildLineAllocationTable(element, build_line, options={}) { columns: [ { field: 'part', - title: '{% jstrans "Part" %}', + title: '{% trans "Part" %}', formatter: function(_value, row) { let html = imageHoverIcon(row.part_detail.thumbnail); html += renderLink(row.part_detail.full_name, `/part/${row.part_detail.pk}/`); @@ -2329,7 +2329,7 @@ function renderBuildLineAllocationTable(element, build_line, options={}) { }, { field: 'quantity', - title: '{% jstrans "Allocated Quantity" %}', + title: '{% trans "Allocated Quantity" %}', formatter: function(_value, row) { let text = ''; let url = ''; @@ -2340,9 +2340,9 @@ function renderBuildLineAllocationTable(element, build_line, options={}) { } if (serial && row.quantity == 1) { - text = `{% jstrans "Serial Number" %}: ${serial}`; + text = `{% trans "Serial Number" %}: ${serial}`; } else { - text = `{% jstrans "Quantity" %}: ${row.quantity}`; + text = `{% trans "Quantity" %}: ${row.quantity}`; if (row.part_detail && row.part_detail.units) { text += ` ${row.part_detail.units}`; } @@ -2357,7 +2357,7 @@ function renderBuildLineAllocationTable(element, build_line, options={}) { }, { field: 'location', - title: '{% jstrans "Location" %}', + title: '{% trans "Location" %}', formatter: function(value, row) { if (row.location_detail) { let text = shortenString(row.location_detail.pathstring); @@ -2365,7 +2365,7 @@ function renderBuildLineAllocationTable(element, build_line, options={}) { return renderLink(text, url); } else { - return '{% jstrans "No location set" %}'; + return '{% trans "No location set" %}'; } } }, @@ -2374,8 +2374,8 @@ function renderBuildLineAllocationTable(element, build_line, options={}) { title: '', formatter: function(value, row) { let buttons = ''; - buttons += makeEditButton('button-allocation-edit', row.pk, '{% jstrans "Edit stock allocation" %}'); - buttons += makeDeleteButton('button-allocation-delete', row.pk, '{% jstrans "Delete stock allocation" %}'); + buttons += makeEditButton('button-allocation-edit', row.pk, '{% trans "Edit stock allocation" %}'); + buttons += makeDeleteButton('button-allocation-delete', row.pk, '{% trans "Delete stock allocation" %}'); return wrapButtons(buttons); } } @@ -2390,7 +2390,7 @@ function renderBuildLineAllocationTable(element, build_line, options={}) { fields: { quantity: {}, }, - title: '{% jstrans "Edit Allocation" %}', + title: '{% trans "Edit Allocation" %}', onSuccess: function() { $(options.parent_table).bootstrapTable('refresh'); }, @@ -2402,7 +2402,7 @@ function renderBuildLineAllocationTable(element, build_line, options={}) { constructForm(`{% url "api-build-item-list" %}${pk}/`, { method: 'DELETE', - title: '{% jstrans "Remove Allocation" %}', + title: '{% trans "Remove Allocation" %}', onSuccess: function() { $(options.parent_table).bootstrapTable('refresh'); }, @@ -2443,8 +2443,8 @@ function loadBuildLineTable(table, build_id, options={}) { url: '{% url "api-buildline-label-list" %}', key: 'line', }, - singular_name: '{% jstrans "build line" %}', - plural_name: '{% jstrans "build lines" %}', + singular_name: '{% trans "build line" %}', + plural_name: '{% trans "build lines" %}', }); } @@ -2462,18 +2462,18 @@ function loadBuildLineTable(table, build_id, options={}) { }); }, formatNoMatches: function() { - return '{% jstrans "No build lines found" %}'; + return '{% trans "No build lines found" %}'; }, columns: [ { checkbox: true, - title: '{% jstrans "Select" %}', + title: '{% trans "Select" %}', searchable: false, switchable: false, }, { field: 'bom_item', - title: '{% jstrans "Required Part" %}', + title: '{% trans "Required Part" %}', switchable: false, sortable: true, sortName: 'part', @@ -2488,11 +2488,11 @@ function loadBuildLineTable(table, build_id, options={}) { html += imageHoverIcon(row.part_detail.thumbnail) + renderLink(row.part_detail.full_name, `/part/${row.part_detail.pk}/`); if (row.bom_item_detail.allow_variants) { - html += makeIconBadge('fa-sitemap', '{% jstrans "Variant stock allowed" %}'); + html += makeIconBadge('fa-sitemap', '{% trans "Variant stock allowed" %}'); } if (row.part_detail.trackable) { - html += makeIconBadge('fa-directions', '{% jstrans "Trackable part" %}'); + html += makeIconBadge('fa-directions', '{% trans "Trackable part" %}'); } return html; @@ -2500,7 +2500,7 @@ function loadBuildLineTable(table, build_id, options={}) { }, { field: 'reference', - title: '{% jstrans "Reference" %}', + title: '{% trans "Reference" %}', sortable: true, formatter: function(value, row) { return row.bom_item_detail.reference; @@ -2508,7 +2508,7 @@ function loadBuildLineTable(table, build_id, options={}) { }, { field: 'consumable', - title: '{% jstrans "Consumable" %}', + title: '{% trans "Consumable" %}', sortable: true, switchable: true, formatter: function(value, row) { @@ -2517,7 +2517,7 @@ function loadBuildLineTable(table, build_id, options={}) { }, { field: 'optional', - title: '{% jstrans "Optional" %}', + title: '{% trans "Optional" %}', sortable: true, switchable: true, formatter: function(value, row) { @@ -2527,7 +2527,7 @@ function loadBuildLineTable(table, build_id, options={}) { { field: 'unit_quantity', sortable: true, - title: '{% jstrans "Unit Quantity" %}', + title: '{% trans "Unit Quantity" %}', formatter: function(value, row) { let text = row.bom_item_detail.quantity; @@ -2544,12 +2544,12 @@ function loadBuildLineTable(table, build_id, options={}) { }, { field: 'quantity', - title: '{% jstrans "Required Quantity" %}', + title: '{% trans "Required Quantity" %}', sortable: true, }, { field: 'available_stock', - title: '{% jstrans "Available" %}', + title: '{% trans "Available" %}', sortable: true, formatter: function(value, row) { var url = `/part/${row.part_detail.pk}/?display=part-stock`; @@ -2573,24 +2573,24 @@ function loadBuildLineTable(table, build_id, options={}) { let icons = ''; if (row.bom_item_detail.consumable) { - icons += ``; + icons += ``; } else { if (available < (row.quantity - row.allocated)) { - icons += makeIconBadge('fa-times-circle icon-red', '{% jstrans "Insufficient stock available" %}'); + icons += makeIconBadge('fa-times-circle icon-red', '{% trans "Insufficient stock available" %}'); } else { - icons += makeIconBadge('fa-check-circle icon-green', '{% jstrans "Sufficient stock available" %}'); + icons += makeIconBadge('fa-check-circle icon-green', '{% trans "Sufficient stock available" %}'); } if (available <= 0) { - icons += `{% jstrans "No Stock Available" %}`; + icons += `{% trans "No Stock Available" %}`; } else { let extra = ''; if ((row.available_substitute_stock > 0) && (row.available_variant_stock > 0)) { - extra = '{% jstrans "Includes variant and substitute stock" %}'; + extra = '{% trans "Includes variant and substitute stock" %}'; } else if (row.available_variant_stock > 0) { - extra = '{% jstrans "Includes variant stock" %}'; + extra = '{% trans "Includes variant stock" %}'; } else if (row.available_substitute_stock > 0) { - extra = '{% jstrans "Includes substitute stock" %}'; + extra = '{% trans "Includes substitute stock" %}'; } if (extra) { @@ -2600,7 +2600,7 @@ function loadBuildLineTable(table, build_id, options={}) { } if (row.on_order && row.on_order > 0) { - icons += makeIconBadge('fa-shopping-cart', `{% jstrans "On Order" %}: ${formatDecimal(row.on_order)}`); + icons += makeIconBadge('fa-shopping-cart', `{% trans "On Order" %}: ${formatDecimal(row.on_order)}`); } return renderLink(text, url) + icons; @@ -2608,7 +2608,7 @@ function loadBuildLineTable(table, build_id, options={}) { }, { field: 'allocated', - title: '{% jstrans "Allocated" %}', + title: '{% trans "Allocated" %}', sortable: true, formatter: function(value, row) { return makeProgressBar(row.allocated, row.quantity); @@ -2625,32 +2625,32 @@ function loadBuildLineTable(table, build_id, options={}) { // Consumable items do not need to be allocated if (row.bom_item_detail.consumable) { - return `{% jstrans "Consumable Item" %}`; + return `{% trans "Consumable Item" %}`; } if (row.part_detail.trackable && !options.output) { // Tracked parts must be allocated to a specific build output - return `{% jstrans "Tracked item" %}`; + return `{% trans "Tracked item" %}`; } if (row.allocated < row.quantity) { // Add a button to "build" stock for this line if (row.part_detail.assembly) { - buttons += makeIconButton('fa-tools icon-blue', 'button-build', pk, '{% jstrans "Build stock" %}'); + buttons += makeIconButton('fa-tools icon-blue', 'button-build', pk, '{% trans "Build stock" %}'); } // Add a button to "purchase" stock for this line if (row.part_detail.purchaseable) { - buttons += makeIconButton('fa-shopping-cart icon-blue', 'button-buy', pk, '{% jstrans "Order stock" %}'); + buttons += makeIconButton('fa-shopping-cart icon-blue', 'button-buy', pk, '{% trans "Order stock" %}'); } // Add a button to "allocate" stock for this line - buttons += makeIconButton('fa-sign-in-alt icon-green', 'button-allocate', pk, '{% jstrans "Allocate stock" %}'); + buttons += makeIconButton('fa-sign-in-alt icon-green', 'button-allocate', pk, '{% trans "Allocate stock" %}'); } if (row.allocated > 0) { - buttons += makeRemoveButton('button-unallocate', pk, '{% jstrans "Remove stock allocation" %}'); + buttons += makeRemoveButton('button-unallocate', pk, '{% trans "Remove stock allocation" %}'); } return wrapButtons(buttons); diff --git a/InvenTree/templates/js/translated/company.js b/InvenTree/templates/js/translated/company.js index 47f564cb81..b1fdacb540 100644 --- a/InvenTree/templates/js/translated/company.js +++ b/InvenTree/templates/js/translated/company.js @@ -95,7 +95,7 @@ function createManufacturerPart(options={}) { } fields.manufacturer.secondary = { - title: '{% jstrans "Add Manufacturer" %}', + title: '{% trans "Add Manufacturer" %}', fields: function() { var company_fields = companyFormFields(); @@ -108,7 +108,7 @@ function createManufacturerPart(options={}) { constructForm('{% url "api-manufacturer-part-list" %}', { fields: fields, method: 'POST', - title: '{% jstrans "Add Manufacturer Part" %}', + title: '{% trans "Add Manufacturer Part" %}', onSuccess: options.onSuccess }); } @@ -129,7 +129,7 @@ function editManufacturerPart(part, options={}) { constructForm(url, { fields: fields, - title: '{% jstrans "Edit Manufacturer Part" %}', + title: '{% trans "Edit Manufacturer Part" %}', onSuccess: options.onSuccess }); } @@ -198,7 +198,7 @@ function createSupplierPart(options={}) { // Add a secondary modal for the supplier fields.supplier.secondary = { - title: '{% jstrans "Add Supplier" %}', + title: '{% trans "Add Supplier" %}', fields: function() { var company_fields = companyFormFields(); @@ -210,7 +210,7 @@ function createSupplierPart(options={}) { // Add a secondary modal for the manufacturer part fields.manufacturer_part.secondary = { - title: '{% jstrans "Add Manufacturer Part" %}', + title: '{% trans "Add Manufacturer Part" %}', fields: function(data) { var mp_fields = manufacturerPartFields(); @@ -240,7 +240,7 @@ function createSupplierPart(options={}) { constructForm('{% url "api-supplier-part-list" %}', { fields: fields, method: 'POST', - title: '{% jstrans "Add Supplier Part" %}', + title: '{% trans "Add Supplier Part" %}', onSuccess: options.onSuccess, header_html: header, }); @@ -266,7 +266,7 @@ function duplicateSupplierPart(part, options={}) { constructForm('{% url "api-supplier-part-list" %}', { method: 'POST', fields: fields, - title: '{% jstrans "Duplicate Supplier Part" %}', + title: '{% trans "Duplicate Supplier Part" %}', data: data, onSuccess: function(response) { handleFormSuccess(response, options); @@ -291,7 +291,7 @@ function editSupplierPart(part, options={}) { constructForm(`{% url "api-supplier-part-list" %}${part}/`, { fields: fields, - title: options.title || '{% jstrans "Edit Supplier Part" %}', + title: options.title || '{% trans "Edit Supplier Part" %}', onSuccess: options.onSuccess }); } @@ -341,14 +341,14 @@ function deleteSupplierParts(parts, options={}) { var html = `
- {% jstrans "All selected supplier parts will be deleted" %} + {% trans "All selected supplier parts will be deleted" %}
{% jstrans "Part" %}{% jstrans "Allocated" %}{% jstrans "Stock Item" %}{% jstrans "Quantity" %}{% trans "Part" %}{% trans "Allocated" %}{% trans "Stock Item" %}{% trans "Quantity" %}
- - - - + + + + ${rows}
{% jstrans "Part" %}{% jstrans "SKU" %}{% jstrans "Supplier" %}{% jstrans "MPN" %}{% trans "Part" %}{% trans "SKU" %}{% trans "Supplier" %}{% trans "MPN" %}
@@ -357,7 +357,7 @@ function deleteSupplierParts(parts, options={}) { constructForm('{% url "api-supplier-part-list" %}', { method: 'DELETE', multi_delete: true, - title: '{% jstrans "Delete Supplier Parts" %}', + title: '{% trans "Delete Supplier Parts" %}', preFormContent: html, form_data: { items: ids, @@ -395,7 +395,7 @@ function createSupplierPartPriceBreak(part_id, options={}) { constructForm('{% url "api-part-supplier-price-list" %}', { fields: fields, method: 'POST', - title: '{% jstrans "Add Price Break" %}', + title: '{% trans "Add Price Break" %}', onSuccess: function(response) { handleFormSuccess(response, options); } @@ -441,7 +441,7 @@ function editCompany(pk, options={}) { method: 'PATCH', fields: fields, reload: true, - title: '{% jstrans "Edit Company" %}', + title: '{% trans "Edit Company" %}', } ); } @@ -462,7 +462,7 @@ function createCompany(options={}) { method: 'POST', fields: fields, follow: true, - title: '{% jstrans "Add new Company" %}', + title: '{% trans "Add new Company" %}', } ); } @@ -492,22 +492,22 @@ function loadCompanyTable(table, url, options={}) { }, { field: 'name', - title: '{% jstrans "Company" %}', + title: '{% trans "Company" %}', sortable: true, switchable: false, formatter: function(value, row) { var html = imageHoverIcon(row.image) + renderLink(value, row.url); if (row.is_customer) { - html += ``; + html += ``; } if (row.is_manufacturer) { - html += ``; + html += ``; } if (row.is_supplier) { - html += ``; + html += ``; } return html; @@ -515,11 +515,11 @@ function loadCompanyTable(table, url, options={}) { }, { field: 'description', - title: '{% jstrans "Description" %}', + title: '{% trans "Description" %}', }, { field: 'website', - title: '{% jstrans "Website" %}', + title: '{% trans "Website" %}', formatter: function(value) { if (value) { return renderLink(value, value); @@ -533,7 +533,7 @@ function loadCompanyTable(table, url, options={}) { columns.push({ sortable: true, field: 'parts_supplied', - title: '{% jstrans "Parts Supplied" %}', + title: '{% trans "Parts Supplied" %}', formatter: function(value, row) { return renderLink(value, `/company/${row.pk}/?display=supplier-parts`); } @@ -542,7 +542,7 @@ function loadCompanyTable(table, url, options={}) { columns.push({ sortable: true, field: 'parts_manufactured', - title: '{% jstrans "Parts Manufactured" %}', + title: '{% trans "Parts Manufactured" %}', formatter: function(value, row) { return renderLink(value, `/company/${row.pk}/?display=manufacturer-parts`); } @@ -557,7 +557,7 @@ function loadCompanyTable(table, url, options={}) { groupBy: false, sidePagination: 'server', formatNoMatches: function() { - return '{% jstrans "No company information found" %}'; + return '{% trans "No company information found" %}'; }, showColumns: true, name: options.pagetype || 'company', @@ -606,7 +606,7 @@ function createContact(options={}) { constructForm('{% url "api-contact-list" %}', { method: 'POST', fields: fields, - title: '{% jstrans "Create New Contact" %}', + title: '{% trans "Create New Contact" %}', onSuccess: function(response) { handleFormSuccess(response, options); } @@ -622,7 +622,7 @@ function editContact(pk, options={}) { constructForm(`{% url "api-contact-list" %}${pk}/`, { fields: fields, - title: '{% jstrans "Edit Contact" %}', + title: '{% trans "Edit Contact" %}', onSuccess: function(response) { handleFormSuccess(response, options); } @@ -659,13 +659,13 @@ function deleteContacts(contacts, options={}) { // eslint-disable-next-line no-useless-escape let html = `
- {% jstrans "All selected contacts will be deleted" %} + {% trans "All selected contacts will be deleted" %}
- - - + + + ${rows}
{% jstrans "Name" %}{% jstrans "Email" %}{% jstrans "Role" %}{% trans "Name" %}{% trans "Email" %}{% trans "Role" %}
`; @@ -673,7 +673,7 @@ function deleteContacts(contacts, options={}) { constructForm('{% url "api-contact-list" %}', { method: 'DELETE', multi_delete: true, - title: '{% jstrans "Delete Contacts" %}', + title: '{% trans "Delete Contacts" %}', preFormContent: html, form_data: { items: ids, @@ -704,32 +704,32 @@ function loadContactTable(table, options={}) { uniqueId: 'pk', sidePagination: 'server', formatNoMatches: function() { - return '{% jstrans "No contacts found" %}'; + return '{% trans "No contacts found" %}'; }, showColumns: true, name: 'contacts', columns: [ { field: 'name', - title: '{% jstrans "Name" %}', + title: '{% trans "Name" %}', sortable: true, switchable: false, }, { field: 'phone', - title: '{% jstrans "Phone Number" %}', + title: '{% trans "Phone Number" %}', sortable: false, switchable: true, }, { field: 'email', - title: '{% jstrans "Email Address" %}', + title: '{% trans "Email Address" %}', sortable: false, switchable: true, }, { field: 'role', - title: '{% jstrans "Role" %}', + title: '{% trans "Role" %}', sortable: false, switchable: false, }, @@ -745,11 +745,11 @@ function loadContactTable(table, options={}) { let html = ''; if (options.allow_edit) { - html += makeEditButton('btn-contact-edit', pk, '{% jstrans "Edit Contact" %}'); + html += makeEditButton('btn-contact-edit', pk, '{% trans "Edit Contact" %}'); } if (options.allow_delete) { - html += makeDeleteButton('btn-contact-delete', pk, '{% jstrans "Delete Contact" %}'); + html += makeDeleteButton('btn-contact-delete', pk, '{% trans "Delete Contact" %}'); } return wrapButtons(html); @@ -846,7 +846,7 @@ function createAddress(options={}) { constructForm('{% url "api-address-list" %}', { method: 'POST', fields: fields, - title: '{% jstrans "Create New Address" %}', + title: '{% trans "Create New Address" %}', onSuccess: function(response) { handleFormSuccess(response, options); } @@ -861,7 +861,7 @@ function editAddress(pk, options={}) { constructForm(`{% url "api-address-list" %}${pk}/`, { fields: fields, - title: '{% jstrans "Edit Address" %}', + title: '{% trans "Edit Address" %}', onSuccess: function(response) { handleFormSuccess(response, options); } @@ -896,13 +896,13 @@ function deleteAddress(addresses, options={}) { let html = `
- {% jstrans "All selected addresses will be deleted" %} + {% trans "All selected addresses will be deleted" %}
- - - + + + ${rows}
{% jstrans "Name" %}{% jstrans "Line 1" %}{% jstrans "Line 2" %}{% trans "Name" %}{% trans "Line 1" %}{% trans "Line 2" %}
`; @@ -910,7 +910,7 @@ function deleteAddress(addresses, options={}) { constructForm('{% url "api-address-list" %}', { method: 'DELETE', multi_delete: true, - title: '{% jstrans "Delete Addresses" %}', + title: '{% trans "Delete Addresses" %}', preFormContent: html, form_data: { items: ids, @@ -937,14 +937,14 @@ function loadAddressTable(table, options={}) { sidePagination: 'server', sortable: true, formatNoMatches: function() { - return '{% jstrans "No addresses found" %}'; + return '{% trans "No addresses found" %}'; }, showColumns: true, name: 'addresses', columns: [ { field: 'primary', - title: '{% jstrans "Primary" %}', + title: '{% trans "Primary" %}', switchable: false, formatter: function(value) { return yesNoLabel(value); @@ -952,61 +952,61 @@ function loadAddressTable(table, options={}) { }, { field: 'title', - title: '{% jstrans "Title" %}', + title: '{% trans "Title" %}', sortable: true, switchable: false, }, { field: 'line1', - title: '{% jstrans "Line 1" %}', + title: '{% trans "Line 1" %}', sortable: false, switchable: false, }, { field: 'line2', - title: '{% jstrans "Line 2" %}', + title: '{% trans "Line 2" %}', sortable: false, switchable: false, }, { field: 'postal_code', - title: '{% jstrans "Postal code" %}', + title: '{% trans "Postal code" %}', sortable: false, switchable: false, }, { field: 'postal_city', - title: '{% jstrans "Postal city" %}', + title: '{% trans "Postal city" %}', sortable: false, switchable: false, }, { field: 'province', - title: '{% jstrans "State/province" %}', + title: '{% trans "State/province" %}', sortable: false, switchable: false, }, { field: 'country', - title: '{% jstrans "Country" %}', + title: '{% trans "Country" %}', sortable: false, switchable: false, }, { field: 'shipping_notes', - title: '{% jstrans "Courier notes" %}', + title: '{% trans "Courier notes" %}', sortable: false, switchable: true, }, { field: 'internal_shipping_notes', - title: '{% jstrans "Internal notes" %}', + title: '{% trans "Internal notes" %}', sortable: false, switchable: true, }, { field: 'link', - title: '{% jstrans "External Link" %}', + title: '{% trans "External Link" %}', sortable: false, switchable: true, }, @@ -1022,11 +1022,11 @@ function loadAddressTable(table, options={}) { let html = ''; if (options.allow_edit) { - html += makeEditButton('btn-address-edit', pk, '{% jstrans "Edit Address" %}'); + html += makeEditButton('btn-address-edit', pk, '{% trans "Edit Address" %}'); } if (options.allow_delete) { - html += makeDeleteButton('btn-address-delete', pk, '{% jstrans "Delete Address" %}'); + html += makeDeleteButton('btn-address-delete', pk, '{% trans "Delete Address" %}'); } return wrapButtons(html); @@ -1099,13 +1099,13 @@ function deleteManufacturerParts(selections, options={}) { var html = `
- {% jstrans "All selected manufacturer parts will be deleted" %} + {% trans "All selected manufacturer parts will be deleted" %}
- - - + + + ${rows}
{% jstrans "Part" %}{% jstrans "MPN" %}{% jstrans "Manufacturer" %}{% trans "Part" %}{% trans "MPN" %}{% trans "Manufacturer" %}
@@ -1114,7 +1114,7 @@ function deleteManufacturerParts(selections, options={}) { constructForm('{% url "api-manufacturer-part-list" %}', { method: 'DELETE', multi_delete: true, - title: '{% jstrans "Delete Manufacturer Parts" %}', + title: '{% trans "Delete Manufacturer Parts" %}', preFormContent: html, form_data: { items: ids, @@ -1148,12 +1148,12 @@ function deleteManufacturerPartParameters(selections, options={}) { var html = `
- {% jstrans "All selected parameters will be deleted" %} + {% trans "All selected parameters will be deleted" %}
- - + + ${rows}
{% jstrans "Name" %}{% jstrans "Value" %}{% trans "Name" %}{% trans "Value" %}
@@ -1162,7 +1162,7 @@ function deleteManufacturerPartParameters(selections, options={}) { constructForm('{% url "api-manufacturer-part-parameter-list" %}', { method: 'DELETE', multi_delete: true, - title: '{% jstrans "Delete Parameters" %}', + title: '{% trans "Delete Parameters" %}', preFormContent: html, form_data: { items: ids, @@ -1178,7 +1178,7 @@ function makeManufacturerPartActions(options={}) { return [ { label: 'order', - title: '{% jstrans "Order parts" %}', + title: '{% trans "Order parts" %}', icon: 'fa-shopping-cart', permission: 'purchase_order.add', callback: function(data) { @@ -1195,7 +1195,7 @@ function makeManufacturerPartActions(options={}) { }, { label: 'delete', - title: '{% jstrans "Delete manufacturer parts" %}', + title: '{% trans "Delete manufacturer parts" %}', icon: 'fa-trash-alt icon-red', permission: 'purchase_order.delete', callback: function(data) { @@ -1227,7 +1227,7 @@ function loadManufacturerPartTable(table, url, options) { custom_actions: [ { label: 'manufacturer-part', - title: '{% jstrans "Manufacturer part actions" %}', + title: '{% trans "Manufacturer part actions" %}', icon: 'fa-tools', actions: makeManufacturerPartActions({ manufacturer_id: options.params.manufacturer, @@ -1246,7 +1246,7 @@ function loadManufacturerPartTable(table, url, options) { name: 'manufacturerparts', groupBy: false, formatNoMatches: function() { - return '{% jstrans "No manufacturer parts found" %}'; + return '{% trans "No manufacturer parts found" %}'; }, columns: [ { @@ -1258,7 +1258,7 @@ function loadManufacturerPartTable(table, url, options) { switchable: params['part_detail'], sortable: true, field: 'part_detail.full_name', - title: '{% jstrans "Part" %}', + title: '{% trans "Part" %}', formatter: function(value, row) { var url = `/part/${row.part}/`; @@ -1266,15 +1266,15 @@ function loadManufacturerPartTable(table, url, options) { var html = imageHoverIcon(row.part_detail.thumbnail) + renderLink(value, url); if (row.part_detail.is_template) { - html += makeIconBadge('fa-clone', '{% jstrans "Template part" %}'); + html += makeIconBadge('fa-clone', '{% trans "Template part" %}'); } if (row.part_detail.assembly) { - html += makeIconBadge('fa-tools', '{% jstrans "Assembled part" %}'); + html += makeIconBadge('fa-tools', '{% trans "Assembled part" %}'); } if (!row.part_detail.active) { - html += `{% jstrans "Inactive" %}`; + html += `{% trans "Inactive" %}`; } return html; @@ -1283,7 +1283,7 @@ function loadManufacturerPartTable(table, url, options) { { sortable: true, field: 'manufacturer', - title: '{% jstrans "Manufacturer" %}', + title: '{% trans "Manufacturer" %}', formatter: function(value, row) { if (value && row.manufacturer_detail) { var name = row.manufacturer_detail.name; @@ -1299,14 +1299,14 @@ function loadManufacturerPartTable(table, url, options) { { sortable: true, field: 'MPN', - title: '{% jstrans "MPN" %}', + title: '{% trans "MPN" %}', formatter: function(value, row) { return renderClipboard(renderLink(value, `/manufacturer-part/${row.pk}/`)); } }, { field: 'link', - title: '{% jstrans "Link" %}', + title: '{% trans "Link" %}', formatter: function(value) { if (value) { return renderLink(value, value, {external: true}); @@ -1317,7 +1317,7 @@ function loadManufacturerPartTable(table, url, options) { }, { field: 'description', - title: '{% jstrans "Description" %}', + title: '{% trans "Description" %}', sortable: false, switchable: true, }, @@ -1330,8 +1330,8 @@ function loadManufacturerPartTable(table, url, options) { let pk = row.pk; let html = ''; - html += makeEditButton('button-manufacturer-part-edit', pk, '{% jstrans "Edit manufacturer part" %}'); - html += makeDeleteButton('button-manufacturer-part-delete', pk, '{% jstrans "Delete manufacturer part" %}'); + html += makeEditButton('button-manufacturer-part-edit', pk, '{% trans "Edit manufacturer part" %}'); + html += makeDeleteButton('button-manufacturer-part-delete', pk, '{% trans "Delete manufacturer part" %}'); return wrapButtons(html); } @@ -1390,7 +1390,7 @@ function loadManufacturerPartParameterTable(table, url, options) { name: 'manufacturerpartparameters', groupBy: false, formatNoMatches: function() { - return '{% jstrans "No parameters found" %}'; + return '{% trans "No parameters found" %}'; }, columns: [ { @@ -1400,19 +1400,19 @@ function loadManufacturerPartParameterTable(table, url, options) { }, { field: 'name', - title: '{% jstrans "Name" %}', + title: '{% trans "Name" %}', switchable: false, sortable: true, }, { field: 'value', - title: '{% jstrans "Value" %}', + title: '{% trans "Value" %}', switchable: false, sortable: true, }, { field: 'units', - title: '{% jstrans "Units" %}', + title: '{% trans "Units" %}', switchable: true, sortable: true, }, @@ -1425,8 +1425,8 @@ function loadManufacturerPartParameterTable(table, url, options) { let pk = row.pk; let html = ''; - html += makeEditButton('button-parameter-edit', pk, '{% jstrans "Edit parameter" %}'); - html += makeDeleteButton('button-parameter-delete', pk, '{% jstrans "Delete parameter" %}'); + html += makeEditButton('button-parameter-edit', pk, '{% trans "Edit parameter" %}'); + html += makeDeleteButton('button-parameter-delete', pk, '{% trans "Delete parameter" %}'); return wrapButtons(html); } @@ -1443,7 +1443,7 @@ function loadManufacturerPartParameterTable(table, url, options) { value: {}, units: {}, }, - title: '{% jstrans "Edit Parameter" %}', + title: '{% trans "Edit Parameter" %}', refreshTable: table, }); }); @@ -1452,7 +1452,7 @@ function loadManufacturerPartParameterTable(table, url, options) { constructForm(`{% url "api-manufacturer-part-parameter-list" %}${pk}/`, { method: 'DELETE', - title: '{% jstrans "Delete Parameter" %}', + title: '{% trans "Delete Parameter" %}', refreshTable: table, }); }); @@ -1466,7 +1466,7 @@ function makeSupplierPartActions(options={}) { return [ { label: 'order', - title: '{% jstrans "Order parts" %}', + title: '{% trans "Order parts" %}', icon: 'fa-shopping-cart', permission: 'purchase_order.add', callback: function(data) { @@ -1483,7 +1483,7 @@ function makeSupplierPartActions(options={}) { }, { label: 'delete', - title: '{% jstrans "Delete supplier parts" %}', + title: '{% trans "Delete supplier parts" %}', icon: 'fa-trash-alt icon-red', permission: 'purchase_order.delete', callback: function(data) { @@ -1513,7 +1513,7 @@ function loadSupplierPartTable(table, url, options) { custom_actions: [ { label: 'supplier-part', - title: '{% jstrans "Supplier part actions" %}', + title: '{% trans "Supplier part actions" %}', icon: 'fa-tools', actions: makeSupplierPartActions({ supplier_id: options.params.supplier, @@ -1533,7 +1533,7 @@ function loadSupplierPartTable(table, url, options) { groupBy: false, sortable: true, formatNoMatches: function() { - return '{% jstrans "No supplier parts found" %}'; + return '{% trans "No supplier parts found" %}'; }, columns: [ { @@ -1546,7 +1546,7 @@ function loadSupplierPartTable(table, url, options) { sortable: true, field: 'part_detail.full_name', sortName: 'part', - title: '{% jstrans "Part" %}', + title: '{% trans "Part" %}', formatter: function(value, row) { var url = `/part/${row.part}/`; @@ -1554,15 +1554,15 @@ function loadSupplierPartTable(table, url, options) { var html = imageHoverIcon(row.part_detail.thumbnail) + renderLink(value, url); if (row.part_detail.is_template) { - html += makeIconBadge('fa-clone', '{% jstrans "Template part" %}'); + html += makeIconBadge('fa-clone', '{% trans "Template part" %}'); } if (row.part_detail.assembly) { - html += makeIconBadge('fa-tools', '{% jstrans "Assembled part" %}'); + html += makeIconBadge('fa-tools', '{% trans "Assembled part" %}'); } if (!row.part_detail.active) { - html += `{% jstrans "Inactive" %}`; + html += `{% trans "Inactive" %}`; } return html; @@ -1571,7 +1571,7 @@ function loadSupplierPartTable(table, url, options) { { sortable: true, field: 'supplier', - title: '{% jstrans "Supplier" %}', + title: '{% trans "Supplier" %}', formatter: function(value, row) { if (value) { var name = row.supplier_detail.name; @@ -1587,7 +1587,7 @@ function loadSupplierPartTable(table, url, options) { { sortable: true, field: 'SKU', - title: '{% jstrans "Supplier Part" %}', + title: '{% trans "Supplier Part" %}', formatter: function(value, row) { return renderClipboard(renderLink(value, `/supplier-part/${row.pk}/`)); } @@ -1598,7 +1598,7 @@ function loadSupplierPartTable(table, url, options) { sortable: true, sortName: 'manufacturer', field: 'manufacturer_detail.name', - title: '{% jstrans "Manufacturer" %}', + title: '{% trans "Manufacturer" %}', formatter: function(value, row) { if (value && row.manufacturer_detail) { var name = value; @@ -1617,7 +1617,7 @@ function loadSupplierPartTable(table, url, options) { sortable: true, sortName: 'MPN', field: 'manufacturer_part_detail.MPN', - title: '{% jstrans "MPN" %}', + title: '{% trans "MPN" %}', formatter: function(value, row) { if (value && row.manufacturer_part) { return renderClipboard(renderLink(value, `/manufacturer-part/${row.manufacturer_part}/`)); @@ -1628,17 +1628,17 @@ function loadSupplierPartTable(table, url, options) { }, { field: 'description', - title: '{% jstrans "Description" %}', + title: '{% trans "Description" %}', sortable: false, }, { field: 'packaging', - title: '{% jstrans "Packaging" %}', + title: '{% trans "Packaging" %}', sortable: true, }, { field: 'pack_quantity', - title: '{% jstrans "Pack Quantity" %}', + title: '{% trans "Pack Quantity" %}', sortable: true, formatter: function(value, row) { @@ -1651,7 +1651,7 @@ function loadSupplierPartTable(table, url, options) { } if (row.part_detail && row.part_detail.units) { - html += ``; + html += ``; } return html; @@ -1660,7 +1660,7 @@ function loadSupplierPartTable(table, url, options) { { field: 'link', sortable: false, - title: '{% jstrans "Link" %}', + title: '{% trans "Link" %}', formatter: function(value) { if (value) { return renderLink(value, value, {external: true}); @@ -1671,17 +1671,17 @@ function loadSupplierPartTable(table, url, options) { }, { field: 'note', - title: '{% jstrans "Notes" %}', + title: '{% trans "Notes" %}', sortable: false, }, { field: 'in_stock', - title: '{% jstrans "In Stock" %}', + title: '{% trans "In Stock" %}', sortable: true, }, { field: 'available', - title: '{% jstrans "Availability" %}', + title: '{% trans "Availability" %}', sortable: true, formatter: function(value, row) { if (row.availability_updated) { @@ -1690,7 +1690,7 @@ function loadSupplierPartTable(table, url, options) { html += makeIconBadge( 'fa-info-circle', - `{% jstrans "Last Updated" %}: ${date}` + `{% trans "Last Updated" %}: ${date}` ); return html; } else { @@ -1700,7 +1700,7 @@ function loadSupplierPartTable(table, url, options) { }, { field: 'updated', - title: '{% jstrans "Last Updated" %}', + title: '{% trans "Last Updated" %}', sortable: true, }, { @@ -1712,8 +1712,8 @@ function loadSupplierPartTable(table, url, options) { let pk = row.pk; let html = ''; - html += makeEditButton('button-supplier-part-edit', pk, '{% jstrans "Edit supplier part" %}'); - html += makeDeleteButton('button-supplier-part-delete', pk, '{% jstrans "Delete supplier part" %}'); + html += makeEditButton('button-supplier-part-edit', pk, '{% trans "Edit supplier part" %}'); + html += makeDeleteButton('button-supplier-part-delete', pk, '{% trans "Delete supplier part" %}'); return wrapButtons(html); } @@ -1766,7 +1766,7 @@ function loadSupplierPriceBreakTable(options={}) { constructForm(`{% url "api-part-supplier-price-list" %}${pk}/`, { method: 'DELETE', - title: '{% jstrans "Delete Price Break" %}', + title: '{% trans "Delete Price Break" %}', refreshTable: table, }); }); @@ -1776,7 +1776,7 @@ function loadSupplierPriceBreakTable(options={}) { constructForm(`{% url "api-part-supplier-price-list" %}${pk}/`, { fields: supplierPartPriceBreakFields(), - title: '{% jstrans "Edit Price Break" %}', + title: '{% trans "Edit Price Break" %}', refreshTable: table, }); }); @@ -1791,7 +1791,7 @@ function loadSupplierPriceBreakTable(options={}) { part: options.part, }, formatNoMatches: function() { - return '{% jstrans "No price break information found" %}'; + return '{% trans "No price break information found" %}'; }, onPostBody: function() { setupCallbacks(); @@ -1805,12 +1805,12 @@ function loadSupplierPriceBreakTable(options={}) { }, { field: 'quantity', - title: '{% jstrans "Quantity" %}', + title: '{% trans "Quantity" %}', sortable: true, }, { field: 'price', - title: '{% jstrans "Price" %}', + title: '{% trans "Price" %}', sortable: true, formatter: function(value, row, index) { return formatCurrency(value, { @@ -1820,15 +1820,15 @@ function loadSupplierPriceBreakTable(options={}) { }, { field: 'updated', - title: '{% jstrans "Last updated" %}', + title: '{% trans "Last updated" %}', sortable: true, formatter: function(value, row) { var html = renderDate(value); let buttons = ''; - buttons += makeEditButton('button-price-break-edit', row.pk, '{% jstrans "Edit price break" %}'); - buttons += makeDeleteButton('button-price-break-delete', row.pk, '{% jstrans "Delete price break" %}'); + buttons += makeEditButton('button-price-break-edit', row.pk, '{% trans "Edit price break" %}'); + buttons += makeDeleteButton('button-price-break-delete', row.pk, '{% trans "Delete price break" %}'); html += wrapButtons(buttons); diff --git a/InvenTree/templates/js/translated/filters.js b/InvenTree/templates/js/translated/filters.js index 798b25a954..51fcc265b6 100644 --- a/InvenTree/templates/js/translated/filters.js +++ b/InvenTree/templates/js/translated/filters.js @@ -183,11 +183,11 @@ function getFilterOptionList(tableKey, filterKey) { return { '1': { key: '1', - value: '{% jstrans "true" %}', + value: '{% trans "true" %}', }, '0': { key: '0', - value: '{% jstrans "false" %}', + value: '{% trans "false" %}', }, }; } else if (settings.type == 'date') { @@ -211,7 +211,7 @@ function generateAvailableFilterList(tableKey) { var html = ` +
@@ -2164,7 +2164,7 @@ function initializeRelatedField(field, fields, options={}) {
`; showQuestionDialog(title, content, { - accept_text: '{% jstrans "Select" %}', + accept_text: '{% trans "Select" %}', accept: () => { const selectedNode = $(`#${tree_id}`).treeview('getSelected'); if(selectedNode.length > 0) { @@ -2268,7 +2268,7 @@ function initializeChoiceField(field, fields, options) { // Render a 'no results' element function searching() { - return `{% jstrans "Searching" %}...`; + return `{% trans "Searching" %}...`; } /* @@ -2482,7 +2482,7 @@ function constructField(name, parameters, options={}) { if (!parameters.required && !options.hideClearButton) { html += ` - `; } @@ -3068,7 +3068,7 @@ function selectImportFields(url, data={}, options={}) { rows += `${field_name}${choice_input}`; } - var headers = `{% jstrans "File Column" %}{% jstrans "Field Name" %}`; + var headers = `{% trans "File Column" %}{% trans "Field Name" %}`; var html = ''; @@ -3080,7 +3080,7 @@ function selectImportFields(url, data={}, options={}) { constructForm(url, { method: 'POST', - title: '{% jstrans "Select Columns" %}', + title: '{% trans "Select Columns" %}', fields: {}, preFormContent: html, onSubmit: function(fields, opts) { diff --git a/InvenTree/templates/js/translated/helpers.js b/InvenTree/templates/js/translated/helpers.js index 10d31fcf5d..dedd3cdc87 100644 --- a/InvenTree/templates/js/translated/helpers.js +++ b/InvenTree/templates/js/translated/helpers.js @@ -74,10 +74,10 @@ function yesNoLabel(value, options={}) { let color = ''; if (toBool(value)) { - text = options.pass || '{% jstrans "YES" %}'; + text = options.pass || '{% trans "YES" %}'; color = 'bg-success'; } else { - text = options.fail || '{% jstrans "NO" %}'; + text = options.fail || '{% trans "NO" %}'; color = 'bg-warning'; } @@ -90,19 +90,19 @@ function yesNoLabel(value, options={}) { function trueFalseLabel(value, options={}) { - options.pass = '{% jstrans "True" %}'; - options.fail = '{% jstrans "False" %}'; + options.pass = '{% trans "True" %}'; + options.fail = '{% trans "False" %}'; return yesNoLabel(value, options); } -function editButton(url, text='{% jstrans "Edit" %}') { +function editButton(url, text='{% trans "Edit" %}') { return ``; } -function deleteButton(url, text='{% jstrans "Delete" %}') { +function deleteButton(url, text='{% trans "Delete" %}') { return ``; } @@ -582,7 +582,7 @@ function renderClipboard(s, prepend=false) { return s; } - let clipString = ``; + let clipString = ``; if (prepend === true) { return `
${clipString+s}
`; diff --git a/InvenTree/templates/js/translated/index.js b/InvenTree/templates/js/translated/index.js index b945a75486..3fe010457c 100644 --- a/InvenTree/templates/js/translated/index.js +++ b/InvenTree/templates/js/translated/index.js @@ -101,12 +101,12 @@ function loadRequiredForBuildsPartsTable(table, options={}) { search: false, sortable: false, formatNoMatches: function() { - return '{% jstrans "No parts required for builds" %}'; + return '{% trans "No parts required for builds" %}'; }, columns: [ { field: 'name', - title: '{% jstrans "Part" %}', + title: '{% trans "Part" %}', formatter: function(value, row) { let name = shortenString(row.full_name); let display= imageHoverIcon(row.thumbnail) + renderLink(name, `/part/${row.pk}/`); @@ -116,18 +116,18 @@ function loadRequiredForBuildsPartsTable(table, options={}) { }, { field: 'description', - title: '{% jstrans "Description" %}', + title: '{% trans "Description" %}', }, { field: 'total_in_stock', - title: '{% jstrans "Available" %}', + title: '{% trans "Available" %}', formatter: function(value, row) { return value; } }, { field: 'allocated_to_build_orders', - title: '{% jstrans "Allocated Stock" %}', + title: '{% trans "Allocated Stock" %}', formatter: function(_value, row) { return makeProgressBar( row.allocated_to_build_orders, diff --git a/InvenTree/templates/js/translated/label.js b/InvenTree/templates/js/translated/label.js index aac0d727cc..a9a75f0f56 100644 --- a/InvenTree/templates/js/translated/label.js +++ b/InvenTree/templates/js/translated/label.js @@ -50,8 +50,8 @@ function printLabels(options) { if (!options.items || options.items.length == 0) { showAlertDialog( - '{% jstrans "Select Items" %}', - '{% jstrans "No items selected for printing" %}', + '{% trans "Select Items" %}', + '{% trans "No items selected for printing" %}', ); return; } @@ -69,8 +69,8 @@ function printLabels(options) { success: function (response) { if (response.length == 0) { showAlertDialog( - '{% jstrans "No Labels Found" %}', - '{% jstrans "No label templates found which match the selected items" %}', + '{% trans "No Labels Found" %}', + '{% trans "No label templates found which match the selected items" %}', ); return; } @@ -94,7 +94,7 @@ function printLabels(options) { if (options.items.length > 1) { header_html += `
- ${options.items.length} ${options.plural_name} {% jstrans "selected" %} + ${options.items.length} ${options.plural_name} {% trans "selected" %}
`; } @@ -130,7 +130,7 @@ function printLabels(options) { if (Object.keys(printingOptions).length > 0) { formOptions.fields = { ...formOptions.fields, - divider: { type: "candy", html: `
{% jstrans "Printing Options" %}
` }, + divider: { type: "candy", html: `
{% trans "Printing Options" %}
` }, ...printingOptions, }; } @@ -145,14 +145,14 @@ function printLabels(options) { } const printingFormOptions = { - title: options.items.length === 1 ? `{% jstrans "Print label" %}` : `{% jstrans "Print labels" %}`, - submitText: `{% jstrans "Print" %}`, + title: options.items.length === 1 ? `{% trans "Print label" %}` : `{% trans "Print labels" %}`, + submitText: `{% trans "Print" %}`, method: "POST", disableSuccessMessage: true, header_html, fields: { _label_template: { - label: `{% jstrans "Select label template" %}`, + label: `{% trans "Select label template" %}`, type: "choice", localOnly: true, value: defaultLabelTemplates[options.key], @@ -165,7 +165,7 @@ function printLabels(options) { } }, _plugin: { - label: `{% jstrans "Select plugin" %}`, + label: `{% trans "Select plugin" %}`, type: "choice", localOnly: true, value: user_settings.LABEL_DEFAULT_PRINTER || plugins[0].key, @@ -184,7 +184,7 @@ function printLabels(options) { // Download the generated file window.open(response.file); } else { - showMessage('{% jstrans "Labels sent to printer" %}', { + showMessage('{% trans "Labels sent to printer" %}', { style: 'success', }); } diff --git a/InvenTree/templates/js/translated/modals.js b/InvenTree/templates/js/translated/modals.js index 848cd7b519..16d823e593 100644 --- a/InvenTree/templates/js/translated/modals.js +++ b/InvenTree/templates/js/translated/modals.js @@ -55,12 +55,12 @@ function createNewModal(options={}) { // Add in a "close" button if (!options.hideCloseButton) { - buttons += ``; + buttons += ``; } // Add in a "submit" button if (!options.hideSubmitButton) { - buttons += ``; + buttons += ``; } var html = ` @@ -71,7 +71,7 @@ function createNewModal(options={}) { - +