From af750f65c39614b83602cbc97b0d1a3894c798a3 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Mon, 11 Jul 2022 13:32:39 +0900 Subject: [PATCH] Replace deprecated ugettext_lazy and ungettext_lazy The ugettext_lazy method and the ungettext_lazy method are both deprecated since Django 3.0[1]. These were already replaced in Horizon repo by [2]. [1] https://docs.djangoproject.com/en/3.0/releases/3.0/#id3 [2] cd7c1b5110fe1f64cd9dfbeb1072b37912d0efee Change-Id: Ib9a4983382efeb4f8292eb275fdb5768d7f60fa7 --- .../dashboards/project/vpn/forms.py | 2 +- .../dashboards/project/vpn/panel.py | 2 +- .../dashboards/project/vpn/tables.py | 24 +++++++++---------- .../dashboards/project/vpn/tabs.py | 2 +- .../dashboards/project/vpn/views.py | 2 +- .../dashboards/project/vpn/workflows.py | 2 +- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/neutron_vpnaas_dashboard/dashboards/project/vpn/forms.py b/neutron_vpnaas_dashboard/dashboards/project/vpn/forms.py index 8b46379..722bfb6 100644 --- a/neutron_vpnaas_dashboard/dashboards/project/vpn/forms.py +++ b/neutron_vpnaas_dashboard/dashboards/project/vpn/forms.py @@ -15,7 +15,7 @@ import logging from django.urls import reverse -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from horizon import exceptions from horizon import forms diff --git a/neutron_vpnaas_dashboard/dashboards/project/vpn/panel.py b/neutron_vpnaas_dashboard/dashboards/project/vpn/panel.py index 9ce2fc2..f35d9bb 100644 --- a/neutron_vpnaas_dashboard/dashboards/project/vpn/panel.py +++ b/neutron_vpnaas_dashboard/dashboards/project/vpn/panel.py @@ -14,7 +14,7 @@ import logging -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ import horizon diff --git a/neutron_vpnaas_dashboard/dashboards/project/vpn/tables.py b/neutron_vpnaas_dashboard/dashboards/project/vpn/tables.py index 2253297..3d173c9 100644 --- a/neutron_vpnaas_dashboard/dashboards/project/vpn/tables.py +++ b/neutron_vpnaas_dashboard/dashboards/project/vpn/tables.py @@ -15,9 +15,9 @@ from django import template from django.urls import reverse +from django.utils.translation import gettext_lazy as _ +from django.utils.translation import ngettext_lazy from django.utils.translation import pgettext_lazy -from django.utils.translation import ugettext_lazy as _ -from django.utils.translation import ungettext_lazy from horizon import exceptions from horizon import tables @@ -81,7 +81,7 @@ class DeleteVPNServiceLink(policy.PolicyTargetMixin, tables.DeleteAction): @staticmethod def action_present(count): - return ungettext_lazy( + return ngettext_lazy( u"Delete VPN Service", u"Delete VPN Services", count @@ -89,7 +89,7 @@ class DeleteVPNServiceLink(policy.PolicyTargetMixin, tables.DeleteAction): @staticmethod def action_past(count): - return ungettext_lazy( + return ngettext_lazy( u"Scheduled deletion of VPN service", u"Scheduled deletion of VPN services", count @@ -114,7 +114,7 @@ class DeleteEndpointGroupLink(policy.PolicyTargetMixin, tables.DeleteAction): @staticmethod def action_present(count): - return ungettext_lazy( + return ngettext_lazy( u"Delete Endpoint Group", u"Delete Endpoint Groups", count @@ -122,7 +122,7 @@ class DeleteEndpointGroupLink(policy.PolicyTargetMixin, tables.DeleteAction): @staticmethod def action_past(count): - return ungettext_lazy( + return ngettext_lazy( u"Scheduled deletion of endpoint group", u"Scheduled deletion of endpoint groups", count @@ -142,7 +142,7 @@ class DeleteIKEPolicyLink(policy.PolicyTargetMixin, tables.DeleteAction): @staticmethod def action_present(count): - return ungettext_lazy( + return ngettext_lazy( u"Delete IKE Policy", u"Delete IKE Policies", count @@ -150,7 +150,7 @@ class DeleteIKEPolicyLink(policy.PolicyTargetMixin, tables.DeleteAction): @staticmethod def action_past(count): - return ungettext_lazy( + return ngettext_lazy( u"Scheduled deletion of IKE policy", u"Scheduled deletion of IKE policies", count @@ -175,7 +175,7 @@ class DeleteIPsecPolicyLink(policy.PolicyTargetMixin, tables.DeleteAction): @staticmethod def action_present(count): - return ungettext_lazy( + return ngettext_lazy( u"Delete IPsec Policy", u"Delete IPsec Policies", count @@ -183,7 +183,7 @@ class DeleteIPsecPolicyLink(policy.PolicyTargetMixin, tables.DeleteAction): @staticmethod def action_past(count): - return ungettext_lazy( + return ngettext_lazy( u"Scheduled deletion of IPsec policy", u"Scheduled deletion of IPsec policies", count @@ -209,7 +209,7 @@ class DeleteIPsecSiteConnectionLink(policy.PolicyTargetMixin, @staticmethod def action_present(count): - return ungettext_lazy( + return ngettext_lazy( u"Delete IPsec Site Connection", u"Delete IPsec Site Connections", count @@ -217,7 +217,7 @@ class DeleteIPsecSiteConnectionLink(policy.PolicyTargetMixin, @staticmethod def action_past(count): - return ungettext_lazy( + return ngettext_lazy( u"Scheduled deletion of IPsec site connection", u"Scheduled deletion of IPsec site connections", count diff --git a/neutron_vpnaas_dashboard/dashboards/project/vpn/tabs.py b/neutron_vpnaas_dashboard/dashboards/project/vpn/tabs.py index de33c12..1306e84 100644 --- a/neutron_vpnaas_dashboard/dashboards/project/vpn/tabs.py +++ b/neutron_vpnaas_dashboard/dashboards/project/vpn/tabs.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from horizon import exceptions from horizon import tables as htables diff --git a/neutron_vpnaas_dashboard/dashboards/project/vpn/views.py b/neutron_vpnaas_dashboard/dashboards/project/vpn/views.py index eab53f5..f6ed650 100644 --- a/neutron_vpnaas_dashboard/dashboards/project/vpn/views.py +++ b/neutron_vpnaas_dashboard/dashboards/project/vpn/views.py @@ -14,7 +14,7 @@ from django.urls import reverse from django.urls import reverse_lazy -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from horizon import exceptions from horizon import forms as horizon_forms diff --git a/neutron_vpnaas_dashboard/dashboards/project/vpn/workflows.py b/neutron_vpnaas_dashboard/dashboards/project/vpn/workflows.py index 19a33cb..8892370 100644 --- a/neutron_vpnaas_dashboard/dashboards/project/vpn/workflows.py +++ b/neutron_vpnaas_dashboard/dashboards/project/vpn/workflows.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from horizon import exceptions from horizon import forms