Skip to content

Commit 696ab96

Browse files
committed
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
1 parent 2fc12a0 commit 696ab96

File tree

20 files changed

+41
-41
lines changed

20 files changed

+41
-41
lines changed

cloudkittydashboard/dashboards/admin/hashmap/forms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from decimal import Decimal
1515
import logging
1616

17-
from django.utils.translation import ugettext_lazy as _
17+
from django.utils.translation import gettext_lazy as _
1818
from horizon import exceptions as horizon_exceptions
1919
from horizon import forms
2020
from horizon import messages

cloudkittydashboard/dashboards/admin/hashmap/panel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# License for the specific language governing permissions and limitations
1313
# under the License.
1414

15-
from django.utils.translation import ugettext_lazy as _
15+
from django.utils.translation import gettext_lazy as _
1616

1717
import horizon
1818

cloudkittydashboard/dashboards/admin/hashmap/tables.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414

1515
from collections import OrderedDict
1616
from django.urls import reverse
17-
from django.utils.translation import ugettext_lazy as _
18-
from django.utils.translation import ungettext_lazy
17+
from django.utils.translation import gettext_lazy as _
18+
from django.utils.translation import ngettext_lazy
1919

2020
from horizon import tables
2121
from horizon import tabs
@@ -40,15 +40,15 @@ class DeleteService(tables.DeleteAction):
4040

4141
@staticmethod
4242
def action_present(count):
43-
return ungettext_lazy(
43+
return ngettext_lazy(
4444
u"Delete Service",
4545
u"Delete Services",
4646
count
4747
)
4848

4949
@staticmethod
5050
def action_past(count):
51-
return ungettext_lazy(
51+
return ngettext_lazy(
5252
u"Deleted Service",
5353
u"Deleted Services",
5454
count
@@ -102,15 +102,15 @@ class DeleteGroup(tables.DeleteAction):
102102

103103
@staticmethod
104104
def action_present(count):
105-
return ungettext_lazy(
105+
return ngettext_lazy(
106106
u"Delete Group",
107107
u"Delete Groups",
108108
count
109109
)
110110

111111
@staticmethod
112112
def action_past(count):
113-
return ungettext_lazy(
113+
return ngettext_lazy(
114114
u"Deleted Group",
115115
u"Deleted Groups",
116116
count
@@ -189,15 +189,15 @@ class DeleteServiceThreshold(tables.DeleteAction):
189189

190190
@staticmethod
191191
def action_present(count):
192-
return ungettext_lazy(
192+
return ngettext_lazy(
193193
u"Delete Service Threshold",
194194
u"Delete Service Thresholds",
195195
count
196196
)
197197

198198
@staticmethod
199199
def action_past(count):
200-
return ungettext_lazy(
200+
return ngettext_lazy(
201201
u"Deleted Service Threshold",
202202
u"Deleted Service Thresholds",
203203
count
@@ -216,15 +216,15 @@ class DeleteFieldThreshold(tables.DeleteAction):
216216

217217
@staticmethod
218218
def action_present(count):
219-
return ungettext_lazy(
219+
return ngettext_lazy(
220220
u"Delete Field Threshold",
221221
u"Delete Field Thresholds",
222222
count
223223
)
224224

225225
@staticmethod
226226
def action_past(count):
227-
return ungettext_lazy(
227+
return ngettext_lazy(
228228
u"Deleted Field Threshold",
229229
u"Deleted Field Thresholds",
230230
count
@@ -356,15 +356,15 @@ class DeleteField(tables.DeleteAction):
356356

357357
@staticmethod
358358
def action_present(count):
359-
return ungettext_lazy(
359+
return ngettext_lazy(
360360
u"Delete Field",
361361
u"Delete Fields",
362362
count
363363
)
364364

365365
@staticmethod
366366
def action_past(count):
367-
return ungettext_lazy(
367+
return ngettext_lazy(
368368
u"Deleted Field",
369369
u"Deleted Fields",
370370
count
@@ -428,15 +428,15 @@ class DeleteMapping(tables.DeleteAction):
428428

429429
@staticmethod
430430
def action_present(count):
431-
return ungettext_lazy(
431+
return ngettext_lazy(
432432
u"Delete Mapping",
433433
u"Delete Mappings",
434434
count
435435
)
436436

437437
@staticmethod
438438
def action_past(count):
439-
return ungettext_lazy(
439+
return ngettext_lazy(
440440
u"Deleted Mapping",
441441
u"Deleted Mappings",
442442
count

cloudkittydashboard/dashboards/admin/hashmap/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
from django.urls import reverse
1717
from django.urls import reverse_lazy
18-
from django.utils.translation import ugettext_lazy as _
18+
from django.utils.translation import gettext_lazy as _
1919
from horizon import forms
2020
from horizon import tables
2121
from horizon import tabs

cloudkittydashboard/dashboards/admin/modules/forms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# License for the specific language governing permissions and limitations
1313
# under the License.
1414

15-
from django.utils.translation import ugettext_lazy as _
15+
from django.utils.translation import gettext_lazy as _
1616
from horizon import exceptions
1717
from horizon import forms
1818
from horizon import messages

cloudkittydashboard/dashboards/admin/modules/panel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# License for the specific language governing permissions and limitations
1313
# under the License.
1414

15-
from django.utils.translation import ugettext_lazy as _
15+
from django.utils.translation import gettext_lazy as _
1616

1717
import horizon
1818

cloudkittydashboard/dashboards/admin/modules/tables.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
# under the License.
1414

1515
from django.urls import reverse
16-
from django.utils.translation import ugettext_lazy as _
17-
from django.utils.translation import ungettext_lazy
16+
from django.utils.translation import gettext_lazy as _
17+
from django.utils.translation import ngettext_lazy
1818

1919
from horizon import tables
2020

@@ -46,12 +46,12 @@ class ToggleEnabledModule(tables.BatchAction):
4646
@staticmethod
4747
def action_present(count):
4848
return (
49-
ungettext_lazy(
49+
ngettext_lazy(
5050
u"Enable Module",
5151
u"Enable Modules",
5252
count
5353
),
54-
ungettext_lazy(
54+
ngettext_lazy(
5555
u"Disable Module",
5656
u"Disable Modules",
5757
count
@@ -61,12 +61,12 @@ def action_present(count):
6161
@staticmethod
6262
def action_past(count):
6363
return (
64-
ungettext_lazy(
64+
ngettext_lazy(
6565
u"Enabled Module",
6666
u"Enabled Modules",
6767
count
6868
),
69-
ungettext_lazy(
69+
ngettext_lazy(
7070
u"Disabled Module",
7171
u"Disabled Modules",
7272
count

cloudkittydashboard/dashboards/admin/modules/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
from django.urls import reverse
1616
from django.urls import reverse_lazy
17-
from django.utils.translation import ugettext_lazy as _
17+
from django.utils.translation import gettext_lazy as _
1818
from horizon import forms
1919
from horizon import tables
2020
from horizon import views

cloudkittydashboard/dashboards/admin/pyscripts/forms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import logging
1616

1717
from django.utils.text import normalize_newlines
18-
from django.utils.translation import ugettext_lazy as _
18+
from django.utils.translation import gettext_lazy as _
1919
from horizon import exceptions
2020
from horizon import forms
2121
from horizon import messages

cloudkittydashboard/dashboards/admin/pyscripts/panel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# License for the specific language governing permissions and limitations
1313
# under the License.
1414

15-
from django.utils.translation import ugettext_lazy as _
15+
from django.utils.translation import gettext_lazy as _
1616

1717
import horizon
1818

0 commit comments

Comments
 (0)