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
This commit is contained in:
Takashi Kajinami 2022-07-10 23:51:49 +09:00
parent 8974cb6771
commit 8ae2c2517d
2 changed files with 9 additions and 7 deletions

View File

@ -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

14
tox.ini
View File

@ -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