From efd14fca6498ef9c27a9c767c944dd4a0877d216 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 4 Apr 2021 22:47:01 +0200 Subject: [PATCH] made translation lazy --- InvenTree/InvenTree/fields.py | 2 +- InvenTree/InvenTree/helpers.py | 2 +- InvenTree/InvenTree/status.py | 2 +- InvenTree/InvenTree/status_codes.py | 2 +- InvenTree/barcodes/api.py | 2 +- InvenTree/common/views.py | 2 +- InvenTree/company/views.py | 2 +- InvenTree/label/api.py | 2 +- InvenTree/order/views.py | 2 +- InvenTree/report/api.py | 2 +- InvenTree/stock/api.py | 1 + 11 files changed, 11 insertions(+), 10 deletions(-) diff --git a/InvenTree/InvenTree/fields.py b/InvenTree/InvenTree/fields.py index c0e1633ac7..d3f60b87df 100644 --- a/InvenTree/InvenTree/fields.py +++ b/InvenTree/InvenTree/fields.py @@ -5,7 +5,7 @@ from __future__ import unicode_literals from .validators import allowable_url_schemes -from django.utils.translation import ugettext as _ +from django.utils.translation import ugettext_lazy as _ from django.forms.fields import URLField as FormURLField from django.db import models as models diff --git a/InvenTree/InvenTree/helpers.py b/InvenTree/InvenTree/helpers.py index 930204c58c..c2441590f5 100644 --- a/InvenTree/InvenTree/helpers.py +++ b/InvenTree/InvenTree/helpers.py @@ -13,7 +13,7 @@ from decimal import Decimal from wsgiref.util import FileWrapper from django.http import StreamingHttpResponse from django.core.exceptions import ValidationError, FieldError -from django.utils.translation import ugettext as _ +from django.utils.translation import ugettext_lazy as _ from django.contrib.auth.models import Permission diff --git a/InvenTree/InvenTree/status.py b/InvenTree/InvenTree/status.py index ec2422a254..646ebb8131 100644 --- a/InvenTree/InvenTree/status.py +++ b/InvenTree/InvenTree/status.py @@ -2,7 +2,7 @@ Provides system status functionality checks. """ -from django.utils.translation import ugettext as _ +from django.utils.translation import ugettext_lazy as _ import logging diff --git a/InvenTree/InvenTree/status_codes.py b/InvenTree/InvenTree/status_codes.py index 916b3341cb..5eb97504c6 100644 --- a/InvenTree/InvenTree/status_codes.py +++ b/InvenTree/InvenTree/status_codes.py @@ -1,4 +1,4 @@ -from django.utils.translation import ugettext as _ +from django.utils.translation import ugettext_lazy as _ class StatusCode: diff --git a/InvenTree/barcodes/api.py b/InvenTree/barcodes/api.py index d727f5a778..e6b3ea84e3 100644 --- a/InvenTree/barcodes/api.py +++ b/InvenTree/barcodes/api.py @@ -2,7 +2,7 @@ from django.urls import reverse from django.conf.urls import url -from django.utils.translation import ugettext as _ +from django.utils.translation import ugettext_lazy as _ from rest_framework.exceptions import ValidationError from rest_framework import permissions diff --git a/InvenTree/common/views.py b/InvenTree/common/views.py index 1f3c827532..31d11e30cc 100644 --- a/InvenTree/common/views.py +++ b/InvenTree/common/views.py @@ -5,7 +5,7 @@ Django views for interacting with common models # -*- coding: utf-8 -*- from __future__ import unicode_literals -from django.utils.translation import ugettext as _ +from django.utils.translation import ugettext_lazy as _ from django.forms import CheckboxInput, Select from InvenTree.views import AjaxUpdateView diff --git a/InvenTree/company/views.py b/InvenTree/company/views.py index 42457d6101..bb16ea4bb6 100644 --- a/InvenTree/company/views.py +++ b/InvenTree/company/views.py @@ -6,7 +6,7 @@ Django views for interacting with Company app # -*- coding: utf-8 -*- from __future__ import unicode_literals -from django.utils.translation import ugettext as _ +from django.utils.translation import ugettext_lazy as _ from django.views.generic import DetailView, ListView, UpdateView from django.urls import reverse diff --git a/InvenTree/label/api.py b/InvenTree/label/api.py index e303f493c6..0d0d71b50d 100644 --- a/InvenTree/label/api.py +++ b/InvenTree/label/api.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals -from django.utils.translation import ugettext as _ +from django.utils.translation import ugettext_lazy as _ from django.conf.urls import url, include from django.core.exceptions import ValidationError, FieldError from django.http import HttpResponse diff --git a/InvenTree/order/views.py b/InvenTree/order/views.py index bdf0407603..f8ac3a9e19 100644 --- a/InvenTree/order/views.py +++ b/InvenTree/order/views.py @@ -9,7 +9,7 @@ from django.db import transaction from django.shortcuts import get_object_or_404 from django.core.exceptions import ValidationError from django.urls import reverse -from django.utils.translation import ugettext as _ +from django.utils.translation import ugettext_lazy as _ from django.views.generic import DetailView, ListView, UpdateView from django.views.generic.edit import FormMixin from django.forms import HiddenInput diff --git a/InvenTree/report/api.py b/InvenTree/report/api.py index 212c57bd7f..0925cc5249 100644 --- a/InvenTree/report/api.py +++ b/InvenTree/report/api.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals -from django.utils.translation import ugettext as _ +from django.utils.translation import ugettext_lazy as _ from django.conf.urls import url, include from django.core.exceptions import ValidationError, FieldError from django.http import HttpResponse diff --git a/InvenTree/stock/api.py b/InvenTree/stock/api.py index 1c04ae7d65..7bad9df83e 100644 --- a/InvenTree/stock/api.py +++ b/InvenTree/stock/api.py @@ -11,6 +11,7 @@ from django.conf.urls import url, include from django.urls import reverse from django.http import JsonResponse from django.db.models import Q +from django.utils.translation import ugettext_lazy as _ from .models import StockLocation, StockItem from .models import StockItemTracking