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: I6697e4c006e7b8ec94a08ad4625a1980582b4d6d
This commit is contained in:
Takashi Kajinami 2022-07-10 23:54:02 +09:00
parent 4afa41b90f
commit 09d63aefbc
30 changed files with 54 additions and 54 deletions

View File

@ -11,7 +11,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from horizon import forms from horizon import forms

View File

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
import horizon import horizon
from mistraldashboard import dashboard from mistraldashboard import dashboard

View File

@ -14,8 +14,8 @@
from django.urls import reverse from django.urls import reverse
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from django.utils.translation import ungettext_lazy from django.utils.translation import ngettext_lazy
from horizon import tables from horizon import tables
@ -37,7 +37,7 @@ class UpdateRow(tables.Row):
class DeleteActionExecution(tables.DeleteAction): class DeleteActionExecution(tables.DeleteAction):
@staticmethod @staticmethod
def action_present(count): def action_present(count):
return ungettext_lazy( return ngettext_lazy(
u"Delete Action Execution", u"Delete Action Execution",
u"Delete Action Executions", u"Delete Action Executions",
count count
@ -45,7 +45,7 @@ class DeleteActionExecution(tables.DeleteAction):
@staticmethod @staticmethod
def action_past(count): def action_past(count):
return ungettext_lazy( return ngettext_lazy(
u"Deleted Action Execution", u"Deleted Action Execution",
u"Deleted Action Executions", u"Deleted Action Executions",
count count

View File

@ -15,7 +15,7 @@
from django.urls import reverse from django.urls import reverse
from django.urls import reverse_lazy from django.urls import reverse_lazy
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from django.views import generic from django.views import generic
from horizon import forms from horizon import forms

View File

@ -15,7 +15,7 @@
import json import json
from django.urls import reverse 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 exceptions
from horizon import forms from horizon import forms

View File

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
import horizon import horizon

View File

@ -13,8 +13,8 @@
# limitations under the License. # limitations under the License.
from django.urls import reverse from django.urls import reverse
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from django.utils.translation import ungettext_lazy from django.utils.translation import ngettext_lazy
from horizon import tables from horizon import tables
from horizon.utils import filters from horizon.utils import filters
@ -45,7 +45,7 @@ class UpdateAction(tables.LinkAction):
class DeleteAction(tables.DeleteAction): class DeleteAction(tables.DeleteAction):
@staticmethod @staticmethod
def action_present(count): def action_present(count):
return ungettext_lazy( return ngettext_lazy(
u"Delete Action", u"Delete Action",
u"Delete Actions", u"Delete Actions",
count count
@ -53,7 +53,7 @@ class DeleteAction(tables.DeleteAction):
@staticmethod @staticmethod
def action_past(count): def action_past(count):
return ungettext_lazy( return ngettext_lazy(
u"Deleted Action", u"Deleted Action",
u"Deleted Actions", u"Deleted Actions",
count count

View File

@ -14,7 +14,7 @@
from django.urls import reverse from django.urls import reverse
from django.urls import reverse_lazy from django.urls import reverse_lazy
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from django.views import generic from django.views import generic
from horizon import exceptions from horizon import exceptions

View File

@ -15,7 +15,7 @@
import itertools import itertools
from django.conf import settings from django.conf import settings
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from horizon.utils import functions as utils from horizon.utils import functions as utils
from horizon.utils import memoized from horizon.utils import memoized

View File

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

View File

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
import horizon import horizon
from mistraldashboard import dashboard from mistraldashboard import dashboard

View File

@ -14,8 +14,8 @@
from django.urls import reverse from django.urls import reverse
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from django.utils.translation import ungettext_lazy from django.utils.translation import ngettext_lazy
from horizon import tables from horizon import tables
@ -34,7 +34,7 @@ class CreateCronTrigger(tables.LinkAction):
class DeleteCronTrigger(tables.DeleteAction): class DeleteCronTrigger(tables.DeleteAction):
@staticmethod @staticmethod
def action_present(count): def action_present(count):
return ungettext_lazy( return ngettext_lazy(
u"Delete Cron Trigger", u"Delete Cron Trigger",
u"Delete Cron Triggers", u"Delete Cron Triggers",
count count
@ -42,7 +42,7 @@ class DeleteCronTrigger(tables.DeleteAction):
@staticmethod @staticmethod
def action_past(count): def action_past(count):
return ungettext_lazy( return ngettext_lazy(
u"Deleted Cron Trigger", u"Deleted Cron Trigger",
u"Deleted Cron Triggers", u"Deleted Cron Triggers",
count count

View File

@ -15,7 +15,7 @@
from django.urls import reverse from django.urls import reverse
from django.urls import reverse_lazy from django.urls import reverse_lazy
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from django.views import generic from django.views import generic
from horizon import forms from horizon import forms

View File

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
import horizon import horizon

View File

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
import horizon import horizon

View File

@ -11,7 +11,7 @@
# limitations under the License. # limitations under the License.
from django.urls import reverse 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 exceptions
from horizon import forms from horizon import forms

View File

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
import horizon import horizon
from mistraldashboard import dashboard from mistraldashboard import dashboard

View File

@ -12,8 +12,8 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from django.utils.translation import ungettext_lazy from django.utils.translation import ngettext_lazy
from horizon import exceptions from horizon import exceptions
from horizon import tables from horizon import tables
@ -29,7 +29,7 @@ smart_cell.init()
class DeleteExecution(tables.DeleteAction): class DeleteExecution(tables.DeleteAction):
@staticmethod @staticmethod
def action_present(count): def action_present(count):
return ungettext_lazy( return ngettext_lazy(
u"Delete Execution", u"Delete Execution",
u"Delete Executions", u"Delete Executions",
count count
@ -37,7 +37,7 @@ class DeleteExecution(tables.DeleteAction):
@staticmethod @staticmethod
def action_past(count): def action_past(count):
return ungettext_lazy( return ngettext_lazy(
u"Deleted Execution", u"Deleted Execution",
u"Deleted Executions", u"Deleted Executions",
count count
@ -53,7 +53,7 @@ class CancelExecution(tables.BatchAction):
@staticmethod @staticmethod
def action_present(count): def action_present(count):
return ungettext_lazy( return ngettext_lazy(
u"Cancel Execution", u"Cancel Execution",
u"Cancel Executions", u"Cancel Executions",
count count
@ -61,7 +61,7 @@ class CancelExecution(tables.BatchAction):
@staticmethod @staticmethod
def action_past(count): def action_past(count):
return ungettext_lazy( return ngettext_lazy(
u"Canceled Execution", u"Canceled Execution",
u"Canceled Executions", u"Canceled Executions",
count count
@ -81,7 +81,7 @@ class PauseExecution(tables.BatchAction):
@staticmethod @staticmethod
def action_present(count): def action_present(count):
return ungettext_lazy( return ngettext_lazy(
u"Pause Execution", u"Pause Execution",
u"Pause Executions", u"Pause Executions",
count count
@ -89,7 +89,7 @@ class PauseExecution(tables.BatchAction):
@staticmethod @staticmethod
def action_past(count): def action_past(count):
return ungettext_lazy( return ngettext_lazy(
u"Paused Execution", u"Paused Execution",
u"Paused Executions", u"Paused Executions",
count count
@ -109,7 +109,7 @@ class ResumeExecution(tables.BatchAction):
@staticmethod @staticmethod
def action_present(count): def action_present(count):
return ungettext_lazy( return ngettext_lazy(
u"Resume Execution", u"Resume Execution",
u"Resume Executions", u"Resume Executions",
count count
@ -117,7 +117,7 @@ class ResumeExecution(tables.BatchAction):
@staticmethod @staticmethod
def action_past(count): def action_past(count):
return ungettext_lazy( return ngettext_lazy(
u"Resumed Execution", u"Resumed Execution",
u"Resumed Executions", u"Resumed Executions",
count count

View File

@ -16,7 +16,7 @@ from django.views import generic
from django.urls import reverse from django.urls import reverse
from django.urls import reverse_lazy 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 exceptions
from horizon import forms from horizon import forms

View File

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
import horizon import horizon
from mistraldashboard import dashboard from mistraldashboard import dashboard

View File

@ -14,7 +14,7 @@
from django.template.defaultfilters import title from django.template.defaultfilters import title
from django.urls import reverse 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 exceptions
from horizon import tables from horizon import tables

View File

@ -15,7 +15,7 @@
from django.urls import reverse from django.urls import reverse
from django.urls import reverse_lazy from django.urls import reverse_lazy
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from django.views import generic from django.views import generic
from horizon import exceptions from horizon import exceptions

View File

@ -13,7 +13,7 @@
# limitations under the License. # limitations under the License.
from django.urls import reverse 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 exceptions
from horizon import forms from horizon import forms

View File

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
import horizon import horizon

View File

@ -12,8 +12,8 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from django.utils.translation import ungettext_lazy from django.utils.translation import ngettext_lazy
from horizon import tables from horizon import tables
from horizon.utils import filters from horizon.utils import filters
@ -40,7 +40,7 @@ class UpdateWorkbook(tables.LinkAction):
class DeleteWorkbook(tables.DeleteAction): class DeleteWorkbook(tables.DeleteAction):
@staticmethod @staticmethod
def action_present(count): def action_present(count):
return ungettext_lazy( return ngettext_lazy(
u"Delete Workbook", u"Delete Workbook",
u"Delete Workbooks", u"Delete Workbooks",
count count
@ -48,7 +48,7 @@ class DeleteWorkbook(tables.DeleteAction):
@staticmethod @staticmethod
def action_past(count): def action_past(count):
return ungettext_lazy( return ngettext_lazy(
u"Deleted Workbook", u"Deleted Workbook",
u"Deleted Workbooks", u"Deleted Workbooks",
count count

View File

@ -14,7 +14,7 @@
from django.urls import reverse from django.urls import reverse
from django.urls import reverse_lazy from django.urls import reverse_lazy
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from django.views import generic from django.views import generic
from horizon import exceptions from horizon import exceptions

View File

@ -13,7 +13,7 @@
# limitations under the License. # limitations under the License.
from django.urls import reverse 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 exceptions
from horizon import forms from horizon import forms

View File

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
import horizon import horizon

View File

@ -13,8 +13,8 @@
# limitations under the License. # limitations under the License.
from django.template.defaultfilters import title from django.template.defaultfilters import title
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from django.utils.translation import ungettext_lazy from django.utils.translation import ngettext_lazy
from horizon import tables from horizon import tables
from horizon.utils import filters from horizon.utils import filters
@ -41,7 +41,7 @@ class UpdateWorkflow(tables.LinkAction):
class DeleteWorkflow(tables.DeleteAction): class DeleteWorkflow(tables.DeleteAction):
@staticmethod @staticmethod
def action_present(count): def action_present(count):
return ungettext_lazy( return ngettext_lazy(
u"Delete Workflow", u"Delete Workflow",
u"Delete Workflows", u"Delete Workflows",
count count
@ -49,7 +49,7 @@ class DeleteWorkflow(tables.DeleteAction):
@staticmethod @staticmethod
def action_past(count): def action_past(count):
return ungettext_lazy( return ngettext_lazy(
u"Deleted Workflow", u"Deleted Workflow",
u"Deleted Workflows", u"Deleted Workflows",
count count

View File

@ -14,7 +14,7 @@
from django.urls import reverse from django.urls import reverse
from django.urls import reverse_lazy from django.urls import reverse_lazy
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from django.views import generic from django.views import generic
from horizon import exceptions from horizon import exceptions