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
This commit is contained in:
Takashi Kajinami 2022-07-11 13:32:39 +09:00
parent 7f951c364b
commit af750f65c3
6 changed files with 17 additions and 17 deletions

View File

@ -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

View File

@ -14,7 +14,7 @@
import logging
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _
import horizon

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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