From 8ae2c2517d9a30b76b202304f0a0318382f8e273 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Sun, 10 Jul 2022 23:51:49 +0900 Subject: [PATCH] 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 This change also removes usage of the deprecated methods in the pybabel command to extract log messages. Change-Id: I6a1f17e310f20e3dc6b510308fb4bd5e768b0212 --- ironic_ui/content/ironic/panel.py | 2 +- tox.ini | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/ironic_ui/content/ironic/panel.py b/ironic_ui/content/ironic/panel.py index 59aaf0ef..6b3b52a2 100644 --- a/ironic_ui/content/ironic/panel.py +++ b/ironic_ui/content/ironic/panel.py @@ -13,7 +13,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 diff --git a/tox.ini b/tox.ini index 84fc89bb..894ba0d6 100644 --- a/tox.ini +++ b/tox.ini @@ -92,11 +92,13 @@ commands = sphinx-build -a -W -E -d releasenotes/build/doctrees -b html releasen [testenv:extractmessages] commands = pybabel extract -F babel-django.cfg \ - -o ironic_ui/locale/django.pot -k gettext_noop -k gettext_lazy -k ngettext_lazy:1,2 \ - -k ugettext_noop -k ugettext_lazy -k ungettext_lazy:1,2 -k npgettext:1c,2,3 \ - -k pgettext_lazy:1c,2 -k npgettext_lazy:1c,2,3 --add-comments Translators: ironic_ui + -o ironic_ui/locale/django.pot \ + -k gettext_noop -k gettext_lazy -k ngettext_lazy:1,2 \ + -k npgettext:1c,2,3 -k pgettext_lazy:1c,2 -k npgettext_lazy:1c,2,3 \ + --add-comments Translators: ironic_ui pybabel extract -F babel-djangojs.cfg \ - -o ironic_ui/locale/djangojs.pot -k gettext_noop -k gettext_lazy -k ngettext_lazy:1,2 \ - -k ugettext_noop -k ugettext_lazy -k ungettext_lazy:1,2 -k npgettext:1c,2,3 \ - -k pgettext_lazy:1c,2 -k npgettext_lazy:1c,2,3 --add-comments Translators: ironic_ui + -o ironic_ui/locale/djangojs.pot \ + -k gettext_noop -k gettext_lazy -k ngettext_lazy:1,2 \ + -k npgettext:1c,2,3 -k pgettext_lazy:1c,2 -k npgettext_lazy:1c,2,3 \ + --add-comments Translators: ironic_ui