Replace deprecated ugettext_lazy

The ugettext_lazy method has been deprecated since Django 3.0[1].

This was already replaced in Horizon repo by [2].

[1] https://docs.djangoproject.com/en/3.0/releases/3.0/#id3
[2] cd7c1b5110fe1f64cd9dfbeb1072b37912d0efee

Change-Id: Ideeaff4a0bc43e69c7465f34062edc5e381932d5
This commit is contained in:
Takashi Kajinami 2022-07-11 13:38:05 +09:00
parent 2fc12a0d34
commit 696ab96b90
20 changed files with 41 additions and 41 deletions

View File

@ -14,7 +14,7 @@
from decimal import Decimal
import logging
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _
from horizon import exceptions as horizon_exceptions
from horizon import forms
from horizon import messages

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 _
import horizon

View File

@ -14,8 +14,8 @@
from collections import OrderedDict
from django.urls import reverse
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import ungettext_lazy
from django.utils.translation import gettext_lazy as _
from django.utils.translation import ngettext_lazy
from horizon import tables
from horizon import tabs
@ -40,7 +40,7 @@ class DeleteService(tables.DeleteAction):
@staticmethod
def action_present(count):
return ungettext_lazy(
return ngettext_lazy(
u"Delete Service",
u"Delete Services",
count
@ -48,7 +48,7 @@ class DeleteService(tables.DeleteAction):
@staticmethod
def action_past(count):
return ungettext_lazy(
return ngettext_lazy(
u"Deleted Service",
u"Deleted Services",
count
@ -102,7 +102,7 @@ class DeleteGroup(tables.DeleteAction):
@staticmethod
def action_present(count):
return ungettext_lazy(
return ngettext_lazy(
u"Delete Group",
u"Delete Groups",
count
@ -110,7 +110,7 @@ class DeleteGroup(tables.DeleteAction):
@staticmethod
def action_past(count):
return ungettext_lazy(
return ngettext_lazy(
u"Deleted Group",
u"Deleted Groups",
count
@ -189,7 +189,7 @@ class DeleteServiceThreshold(tables.DeleteAction):
@staticmethod
def action_present(count):
return ungettext_lazy(
return ngettext_lazy(
u"Delete Service Threshold",
u"Delete Service Thresholds",
count
@ -197,7 +197,7 @@ class DeleteServiceThreshold(tables.DeleteAction):
@staticmethod
def action_past(count):
return ungettext_lazy(
return ngettext_lazy(
u"Deleted Service Threshold",
u"Deleted Service Thresholds",
count
@ -216,7 +216,7 @@ class DeleteFieldThreshold(tables.DeleteAction):
@staticmethod
def action_present(count):
return ungettext_lazy(
return ngettext_lazy(
u"Delete Field Threshold",
u"Delete Field Thresholds",
count
@ -224,7 +224,7 @@ class DeleteFieldThreshold(tables.DeleteAction):
@staticmethod
def action_past(count):
return ungettext_lazy(
return ngettext_lazy(
u"Deleted Field Threshold",
u"Deleted Field Thresholds",
count
@ -356,7 +356,7 @@ class DeleteField(tables.DeleteAction):
@staticmethod
def action_present(count):
return ungettext_lazy(
return ngettext_lazy(
u"Delete Field",
u"Delete Fields",
count
@ -364,7 +364,7 @@ class DeleteField(tables.DeleteAction):
@staticmethod
def action_past(count):
return ungettext_lazy(
return ngettext_lazy(
u"Deleted Field",
u"Deleted Fields",
count
@ -428,7 +428,7 @@ class DeleteMapping(tables.DeleteAction):
@staticmethod
def action_present(count):
return ungettext_lazy(
return ngettext_lazy(
u"Delete Mapping",
u"Delete Mappings",
count
@ -436,7 +436,7 @@ class DeleteMapping(tables.DeleteAction):
@staticmethod
def action_past(count):
return ungettext_lazy(
return ngettext_lazy(
u"Deleted Mapping",
u"Deleted Mappings",
count

View File

@ -15,7 +15,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 forms
from horizon import tables
from horizon import tabs

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
from horizon import messages

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 _
import horizon

View File

@ -13,8 +13,8 @@
# under the License.
from django.urls import reverse
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import ungettext_lazy
from django.utils.translation import gettext_lazy as _
from django.utils.translation import ngettext_lazy
from horizon import tables
@ -46,12 +46,12 @@ class ToggleEnabledModule(tables.BatchAction):
@staticmethod
def action_present(count):
return (
ungettext_lazy(
ngettext_lazy(
u"Enable Module",
u"Enable Modules",
count
),
ungettext_lazy(
ngettext_lazy(
u"Disable Module",
u"Disable Modules",
count
@ -61,12 +61,12 @@ class ToggleEnabledModule(tables.BatchAction):
@staticmethod
def action_past(count):
return (
ungettext_lazy(
ngettext_lazy(
u"Enabled Module",
u"Enabled Modules",
count
),
ungettext_lazy(
ngettext_lazy(
u"Disabled Module",
u"Disabled Modules",
count

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 forms
from horizon import tables
from horizon import views

View File

@ -15,7 +15,7 @@
import logging
from django.utils.text import normalize_newlines
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

@ -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 _
import horizon

View File

@ -13,8 +13,8 @@
# under the License.
from django.urls import reverse
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import ungettext_lazy
from django.utils.translation import gettext_lazy as _
from django.utils.translation import ngettext_lazy
from horizon import tables
@ -55,7 +55,7 @@ class DeletePyScript(tables.DeleteAction):
@staticmethod
def action_present(count):
return ungettext_lazy(
return ngettext_lazy(
u"Delete PyScript",
u"Delete PyScripts",
count
@ -63,7 +63,7 @@ class DeletePyScript(tables.DeleteAction):
@staticmethod
def action_past(count):
return ungettext_lazy(
return ngettext_lazy(
u"Deleted PyScript",
u"Deleted PyScripts",
count

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 forms
from horizon import tables
from horizon import views

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 _
import horizon

View File

@ -13,7 +13,7 @@
# under the License.
from django.urls import reverse
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _
from horizon import tables

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 tables
from openstack_dashboard.api import keystone as api_keystone

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 _
import horizon
from openstack_dashboard.dashboards.project import dashboard

View File

@ -11,7 +11,7 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# 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 tables

View File

@ -15,7 +15,7 @@ import json
from django.conf import settings
from django import http
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _
from horizon import exceptions
from horizon import tables

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 _
import horizon
from openstack_dashboard.dashboards.project import dashboard

View File

@ -14,7 +14,7 @@
# under the License.
#
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _
from openstack_dashboard.dashboards.project.instances.workflows \
import create_instance