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: If17fba432f4a00979f70b535bc1f1750d8a15f19
This commit is contained in:
Takashi Kajinami 2022-07-11 13:35:14 +09:00
parent 31a03f6339
commit 444a209cb1
7 changed files with 14 additions and 14 deletions

View File

@ -16,7 +16,7 @@ import logging
from operator import attrgetter
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
from horizon import messages

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
from openstack_dashboard.api import neutron

View File

@ -16,9 +16,9 @@ import logging
from django.template import defaultfilters as filters
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
@ -65,7 +65,7 @@ class DeleteRuleLink(policy.PolicyTargetMixin, tables.DeleteAction):
@staticmethod
def action_present(count):
return ungettext_lazy(
return ngettext_lazy(
u"Delete Rule",
u"Delete Rules",
count
@ -73,7 +73,7 @@ class DeleteRuleLink(policy.PolicyTargetMixin, tables.DeleteAction):
@staticmethod
def action_past(count):
return ungettext_lazy(
return ngettext_lazy(
u"Scheduled deletion of Rule",
u"Scheduled deletion of Rules",
count
@ -97,7 +97,7 @@ class DeletePolicyLink(policy.PolicyTargetMixin, tables.DeleteAction):
@staticmethod
def action_present(count):
return ungettext_lazy(
return ngettext_lazy(
u"Delete Policy",
u"Delete Policies",
count
@ -105,7 +105,7 @@ class DeletePolicyLink(policy.PolicyTargetMixin, tables.DeleteAction):
@staticmethod
def action_past(count):
return ungettext_lazy(
return ngettext_lazy(
u"Scheduled deletion of Policy",
u"Scheduled deletion of Policies",
count
@ -125,7 +125,7 @@ class DeleteFirewallGroupLink(policy.PolicyTargetMixin,
@staticmethod
def action_present(count):
return ungettext_lazy(
return ngettext_lazy(
u"Delete Firewall Group",
u"Delete Firewall Groups",
count
@ -133,7 +133,7 @@ class DeleteFirewallGroupLink(policy.PolicyTargetMixin,
@staticmethod
def action_past(count):
return ungettext_lazy(
return ngettext_lazy(
u"Scheduled deletion of Firewall Group",
u"Scheduled deletion of Firewall Groups",
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 tabs

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

View File

@ -13,7 +13,7 @@
import itertools
from django.template.loader import get_template
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _
from horizon.forms import fields
"""A custom Horizon Forms Select widget that displays select choices as a table

View File

@ -13,7 +13,7 @@
# under the License.
from operator import attrgetter
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _
from horizon import exceptions
from horizon import forms
from horizon.utils import validators