Address RemovedInDjango40Warning (2)

django.utils.translation.ugettext(), ugettext_lazy(), ugettext_noop(),
ungettext(), and ungettext_lazy() are deprecated in favor of the
functions that they’re aliases for: django.utils.translation.gettext(),
gettext_lazy(), gettext_noop(), ngettext(), and ngettext_lazy().

https://docs.djangoproject.com/en/4.0/releases/3.0/#id3

Change-Id: I77878f84e9d10cf6a136dada81eabf4e18676250
This commit is contained in:
Akihiro Motoki 2022-01-26 22:42:15 +09:00
parent a9d5273f3c
commit cd7c1b5110
346 changed files with 529 additions and 529 deletions

View File

@ -176,7 +176,7 @@ The standard installation uses a non-encrypted HTTP channel.
import os import os
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
DEBUG = False DEBUG = False
TEMPLATE_DEBUG = DEBUG TEMPLATE_DEBUG = DEBUG

View File

@ -112,7 +112,7 @@ module in dotted python path notation. Example::
You can do essentially anything you like in the customization module. For You can do essentially anything you like in the customization module. For
example, you could change the name of a panel:: example, you could change the name of a panel::
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
import horizon import horizon
@ -208,7 +208,7 @@ Horizon is able to show these extra information as a custom column.
For example, if a user in Keystone has an attribute ``phone_num``, you could For example, if a user in Keystone has an attribute ``phone_num``, you could
define new column:: define new column::
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 tables from horizon import tables

View File

@ -119,9 +119,9 @@ scenarios, such as interpolation, contextual markers and translation comments.
.. code-block:: python .. code-block:: python
from django.utils.translation import gettext as _
from django.utils.translation import ngettext
from django.utils.translation import pgettext from django.utils.translation import pgettext
from django.utils.translation import ugettext as _
from django.utils.translation import ungettext
class IndexView(request): class IndexView(request):
@ -129,7 +129,7 @@ scenarios, such as interpolation, contextual markers and translation comments.
_("Images") _("Images")
# Plural example # Plural example
ungettext( ngettext(
"there is %(count)d object", "there is %(count)d object",
"there are %(count)d objects", "there are %(count)d objects",
count) % { "count": count } count) % { "count": count }
@ -142,11 +142,11 @@ scenarios, such as interpolation, contextual markers and translation comments.
pgettext("the month name", "May") pgettext("the month name", "May")
# Translators: This message appears as a comment for translators! # Translators: This message appears as a comment for translators!
ugettext("Welcome translators.") gettext("Welcome translators.")
.. note:: .. note::
In the example above, we imported ``ugettext`` as ``_``. This is a common In the example above, we imported ``gettext`` as ``_``. This is a common
alias for gettext or any of its variants. alias for gettext or any of its variants.
In Django templates In Django templates

View File

@ -93,7 +93,7 @@ Defining a dashboard
Open the ``dashboard.py`` file. You will notice the following code has been Open the ``dashboard.py`` file. You will notice the following code has been
automatically generated:: automatically generated::
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
import horizon import horizon
@ -154,7 +154,7 @@ thoroughly vetted in Django's admin codebase).
Open the ``panel.py`` file, you will have the following auto-generated code:: Open the ``panel.py`` file, you will have the following auto-generated code::
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
import horizon import horizon
@ -199,7 +199,7 @@ the default panel::
The completed ``dashboard.py`` file should look like The completed ``dashboard.py`` file should look like
the following:: the following::
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
import horizon import horizon
@ -236,7 +236,7 @@ displaying data to an end-user. We're just going to skim the surface here, but
it has a tremendous number of capabilities. Create a ``tables.py`` file under it has a tremendous number of capabilities. Create a ``tables.py`` file under
the ``mypanel`` directory and add the following code:: the ``mypanel`` directory and add the following code::
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from horizon import tables from horizon import tables
@ -311,7 +311,7 @@ Then, we add that action to the table actions for our table.::
The completed ``tables.py`` file should look like the following:: The completed ``tables.py`` file should look like the following::
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from horizon import tables from horizon import tables
@ -347,7 +347,7 @@ Create a ``tabs.py`` file under the ``mypanel`` directory. Let's make a tab
group which has one tab. The completed code should look like the following:: group which has one tab. The completed code should look like the following::
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 tabs from horizon import tabs

View File

@ -190,7 +190,7 @@ necessity even for Angular plugins. The slug is the panel's unique identifier
and is often use as part of the URL. Make sure that it matches what you have in and is often use as part of the URL. Make sure that it matches what you have in
your enabled file.:: your enabled file.::
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
import horizon import horizon

View File

@ -69,7 +69,7 @@ Create the ``forms.py`` file under the ``mypanel`` directory and add the
following:: following::
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
@ -107,7 +107,7 @@ file should now look something like this::
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 tabs from horizon import tabs
from horizon import exceptions from horizon import exceptions
@ -232,7 +232,7 @@ We must also add our new action as a row action for the table::
The complete ``tables.py`` file should look like this:: The complete ``tables.py`` file should look like this::
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from horizon import tables from horizon import tables

View File

@ -37,7 +37,7 @@ from django.urls import reverse
from django.utils.functional import empty from django.utils.functional import empty
from django.utils.functional import SimpleLazyObject from django.utils.functional import SimpleLazyObject
from django.utils.module_loading import module_has_submodule from django.utils.module_loading import module_has_submodule
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from horizon import conf from horizon import conf
from horizon.decorators import _current_component from horizon.decorators import _current_component

View File

@ -13,7 +13,7 @@
# under the License. # under the License.
from django import template from django import template
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from horizon.browsers.breadcrumb import Breadcrumb from horizon.browsers.breadcrumb import Breadcrumb
from horizon.tables import DataTable from horizon.tables import DataTable

View File

@ -13,7 +13,7 @@
# under the License. # under the License.
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 django.views import generic from django.views import generic
import horizon import horizon

View File

@ -11,7 +11,7 @@
# under the License. # under the License.
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 _
# Default configuration dictionary. Do not mutate. # Default configuration dictionary. Do not mutate.
HORIZON_CONFIG = { HORIZON_CONFIG = {

View File

@ -21,7 +21,7 @@ General-purpose decorators for use with Horizon.
""" """
import functools import functools
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
def _current_component(view_func, dashboard=None, panel=None): def _current_component(view_func, dashboard=None, panel=None):

View File

@ -11,7 +11,7 @@
# under the License. # under the License.
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 openstack_auth.defaults import * # noqa: F401,F403,H303 from openstack_auth.defaults import * # noqa: F401,F403,H303

View File

@ -23,7 +23,7 @@ import sys
from debtcollector import removals from debtcollector import removals
from django.core.management import color_style from django.core.management import color_style
from django.utils import encoding from django.utils import encoding
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from django.views.debug import SafeExceptionReporterFilter from django.views.debug import SafeExceptionReporterFilter
from horizon.conf import HORIZON_CONFIG from horizon.conf import HORIZON_CONFIG

View File

@ -31,7 +31,7 @@ from django.utils.encoding import force_str
from django.utils.functional import Promise from django.utils.functional import Promise
from django.utils import html from django.utils import html
from django.utils.safestring import mark_safe from django.utils.safestring import mark_safe
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
ip_allowed_symbols_re = re.compile(r'^[a-fA-F0-9:/\.]+$') ip_allowed_symbols_re = re.compile(r'^[a-fA-F0-9:/\.]+$')
IPv4 = 1 IPv4 = 1

View File

@ -17,7 +17,7 @@ import os
from django.conf import settings from django.conf import settings
from django import http 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 exceptions
from horizon import views from horizon import views

View File

@ -18,7 +18,7 @@ import logging
import os import os
from django.utils.safestring import mark_safe from django.utils.safestring import mark_safe
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 messages from horizon import messages

View File

@ -25,7 +25,7 @@ from django.template.loader import render_to_string
from django import urls from django import urls
from django.utils.functional import Promise from django.utils.functional import Promise
from django.utils.http import urlencode from django.utils.http import urlencode
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 messages from horizon import messages

View File

@ -36,7 +36,7 @@ from django.utils import http
from django.utils.http import urlencode from django.utils.http import urlencode
from django.utils.safestring import mark_safe from django.utils.safestring import mark_safe
from django.utils import termcolors from django.utils import termcolors
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from horizon import conf from horizon import conf
from horizon import exceptions from horizon import exceptions

View File

@ -19,7 +19,7 @@ from django import template
from django.template import Node from django.template import Node
from django.utils.encoding import force_str from django.utils.encoding import force_str
from django.utils import translation from django.utils import translation
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from horizon.base import Horizon from horizon.base import Horizon
from horizon import conf from horizon import conf

View File

@ -24,8 +24,8 @@ from oslo_utils import units
from django import template from django import template
from django.utils import formats from django.utils import formats
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
register = template.Library() register = template.Library()
@ -48,15 +48,15 @@ def filesizeformat(bytes, filesize_number_format):
try: try:
bytes = float(bytes) bytes = float(bytes)
except (TypeError, ValueError, UnicodeDecodeError): except (TypeError, ValueError, UnicodeDecodeError):
return ungettext_lazy("%(size)d B", return ngettext_lazy("%(size)d B",
"%(size)d B", 0) % {'size': 0} "%(size)d B", 0) % {'size': 0}
if bytes == float('inf'): if bytes == float('inf'):
return _('Infinity') return _('Infinity')
if bytes < units.Ki: if bytes < units.Ki:
bytes = int(bytes) bytes = int(bytes)
return ungettext_lazy("%(size)d B", return ngettext_lazy("%(size)d B",
"%(size)d B", bytes) % {'size': bytes} "%(size)d B", bytes) % {'size': bytes}
if bytes < units.Mi: if bytes < units.Mi:
return _("%s KB") % filesize_number_format(bytes / units.Ki) return _("%s KB") % filesize_number_format(bytes / units.Ki)
if bytes < units.Gi: if bytes < units.Gi:

View File

@ -10,7 +10,7 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from django.utils.translation import ungettext_lazy from django.utils.translation import ngettext_lazy
from horizon import tables from horizon import tables
@ -27,7 +27,7 @@ class SellPuppy(tables.DeleteAction):
@staticmethod @staticmethod
def action_present(count): def action_present(count):
# Translators: test code, don't really have to translate # Translators: test code, don't really have to translate
return ungettext_lazy( return ngettext_lazy(
"Sell Puppy", "Sell Puppy",
"Sell Puppies", "Sell Puppies",
count count
@ -36,7 +36,7 @@ class SellPuppy(tables.DeleteAction):
@staticmethod @staticmethod
def action_past(count): def action_past(count):
# Translators: test code, don't really have to translate # Translators: test code, don't really have to translate
return ungettext_lazy( return ngettext_lazy(
"Sold Puppy", "Sold Puppy",
"Sold Puppies", "Sold Puppies",
count count

View File

@ -25,7 +25,7 @@ from django import shortcuts
from django.template import defaultfilters from django.template import defaultfilters
from django.test.utils import override_settings from django.test.utils import override_settings
from django.urls import reverse from django.urls import reverse
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
@ -157,7 +157,7 @@ class MyBatchAction(tables.BatchAction):
@staticmethod @staticmethod
def action_present(count): def action_present(count):
# Translators: test code, don't really have to translate # Translators: test code, don't really have to translate
return ungettext_lazy( return ngettext_lazy(
"Batch Item", "Batch Item",
"Batch Items", "Batch Items",
count count
@ -166,7 +166,7 @@ class MyBatchAction(tables.BatchAction):
@staticmethod @staticmethod
def action_past(count): def action_past(count):
# Translators: test code, don't really have to translate # Translators: test code, don't really have to translate
return ungettext_lazy( return ngettext_lazy(
"Batched Item", "Batched Item",
"Batched Items", "Batched Items",
count count
@ -194,14 +194,14 @@ class MyToggleAction(tables.BatchAction):
def action_present(self, count): def action_present(self, count):
if self.current_present_action: if self.current_present_action:
# Translators: test code, don't really have to translate # Translators: test code, don't really have to translate
return ungettext_lazy( return ngettext_lazy(
"Up Item", "Up Item",
"Up Items", "Up Items",
count count
) )
else: else:
# Translators: test code, don't really have to translate # Translators: test code, don't really have to translate
return ungettext_lazy( return ngettext_lazy(
"Down Item", "Down Item",
"Down Items", "Down Items",
count count
@ -210,14 +210,14 @@ class MyToggleAction(tables.BatchAction):
def action_past(self, count): def action_past(self, count):
if self.current_past_action: if self.current_past_action:
# Translators: test code, don't really have to translate # Translators: test code, don't really have to translate
return ungettext_lazy( return ngettext_lazy(
"Upped Item", "Upped Item",
"Upped Items", "Upped Items",
count count
) )
else: else:
# Translators: test code, don't really have to translate # Translators: test code, don't really have to translate
return ungettext_lazy( return ngettext_lazy(
"Downed Item", "Downed Item",
"Downed Items", "Downed Items",
count count

View File

@ -14,7 +14,7 @@
from django import forms from django import forms
from django.test import client from django.test import client
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.test import helpers as test from horizon.test import helpers as test

View File

@ -20,7 +20,7 @@ from django.template.defaultfilters import register
from django.template.defaultfilters import timesince from django.template.defaultfilters import timesince
from django.utils.safestring import mark_safe from django.utils.safestring import mark_safe
from django.utils import timezone from django.utils import timezone
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
@register.filter @register.filter

View File

@ -18,7 +18,7 @@ from oslo_utils import netutils
from django.core.exceptions import ValidationError from django.core.exceptions import ValidationError
from django.core import validators from django.core import validators
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from horizon import conf from horizon import conf

View File

@ -28,7 +28,7 @@ from django.template.defaultfilters import slugify
from django import urls from django import urls
from django.utils.encoding import force_str from django.utils.encoding import force_str
from django.utils import module_loading from django.utils import module_loading
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from openstack_auth import policy from openstack_auth import policy
from horizon import base from horizon import base

View File

@ -20,7 +20,7 @@ import pytz
from django.conf import settings from django.conf import settings
from django.utils.module_loading import import_string from django.utils.module_loading import import_string
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from openstack_auth import exceptions from openstack_auth import exceptions
from openstack_auth import user as auth_user from openstack_auth import user as auth_user

View File

@ -18,7 +18,7 @@ from django.conf import settings
from django.contrib.auth import authenticate from django.contrib.auth import authenticate
from django.contrib.auth import forms as django_auth_forms from django.contrib.auth import forms as django_auth_forms
from django import forms from django import forms
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from django.views.decorators.debug import sensitive_variables from django.views.decorators.debug import sensitive_variables
from keystoneauth1 import plugin as auth_plugin from keystoneauth1 import plugin as auth_plugin

View File

@ -14,7 +14,7 @@ import abc
import logging import logging
import re import re
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from keystoneauth1 import exceptions as keystone_exceptions from keystoneauth1 import exceptions as keystone_exceptions
from keystoneclient.v3 import client as v3_client from keystoneclient.v3 import client as v3_client

View File

@ -14,7 +14,7 @@
import logging import logging
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 keystoneauth1.identity import v3 as v3_auth from keystoneauth1.identity import v3 as v3_auth
from openstack_auth import exceptions from openstack_auth import exceptions

View File

@ -24,7 +24,7 @@ from django.middleware import csrf
from django import shortcuts from django import shortcuts
from django.urls import reverse from django.urls import reverse
from django.utils import http from django.utils import http
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from django.views.decorators.cache import never_cache from django.views.decorators.cache import never_cache
from django.views.decorators.csrf import csrf_exempt from django.views.decorators.csrf import csrf_exempt
from django.views.decorators.csrf import csrf_protect from django.views.decorators.csrf import csrf_protect

View File

@ -22,8 +22,8 @@ import logging
import math import math
from django.conf import settings from django.conf import settings
from django.utils.translation import gettext_lazy as _
from django.utils.translation import pgettext_lazy from django.utils.translation import pgettext_lazy
from django.utils.translation import ugettext_lazy as _
from cinderclient import api_versions from cinderclient import api_versions
from cinderclient import client as cinder_client from cinderclient import client as cinder_client

View File

@ -28,7 +28,7 @@ from django.conf import settings
from django.core.files.uploadedfile import InMemoryUploadedFile from django.core.files.uploadedfile import InMemoryUploadedFile
from django.core.files.uploadedfile import SimpleUploadedFile from django.core.files.uploadedfile import SimpleUploadedFile
from django.core.files.uploadedfile import TemporaryUploadedFile from django.core.files.uploadedfile import TemporaryUploadedFile
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from glanceclient.v2 import client from glanceclient.v2 import client

View File

@ -22,7 +22,7 @@ import logging
from urllib import parse from urllib import parse
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 keystoneauth1 import session from keystoneauth1 import session
from keystoneauth1 import token_endpoint from keystoneauth1 import token_endpoint

View File

@ -26,7 +26,7 @@ import logging
import netaddr import netaddr
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 neutronclient.common import exceptions as neutron_exc from neutronclient.common import exceptions as neutron_exc
from neutronclient.v2_0 import client as neutron_client from neutronclient.v2_0 import client as neutron_client
from novaclient import exceptions as nova_exc from novaclient import exceptions as nova_exc

View File

@ -22,7 +22,7 @@ import collections
import logging import logging
from operator import attrgetter from operator import attrgetter
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from novaclient import api_versions from novaclient import api_versions
from novaclient import exceptions as nova_exceptions from novaclient import exceptions as nova_exceptions

View File

@ -13,7 +13,7 @@
# limitations under the License. # limitations under the License.
"""API over the cinder service.""" """API over the cinder service."""
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 openstack_dashboard import api from openstack_dashboard import api

View File

@ -14,7 +14,7 @@
import json import json
import json.encoder as encoder import json.encoder as encoder
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
class NaNJSONEncoder(json.JSONEncoder): class NaNJSONEncoder(json.JSONEncoder):

View File

@ -14,7 +14,7 @@
# limitations under the License. # limitations under the License.
"""API over the neutron service.""" """API over the neutron service."""
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 openstack_dashboard import api from openstack_dashboard import api

View File

@ -15,7 +15,7 @@
from collections import OrderedDict from collections import OrderedDict
from django.utils import http as utils_http from django.utils import http as utils_http
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 novaclient import exceptions from novaclient import exceptions

View File

@ -24,7 +24,7 @@ import functools
import swiftclient import swiftclient
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 import exceptions from horizon import exceptions

View File

@ -13,7 +13,7 @@
# under the License. # under the License.
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 _
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

@ -17,7 +17,7 @@ from django.conf import settings
from django.core import exceptions from django.core import exceptions
from django.urls import reverse from django.urls import reverse
from django.utils import safestring from django.utils import safestring
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from osprofiler import _utils as profiler_utils from osprofiler import _utils as profiler_utils
from osprofiler import profiler from osprofiler import profiler
from osprofiler import web from osprofiler import web

View File

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

View File

@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
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 views from horizon import views

View File

@ -12,7 +12,7 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # 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,7 +13,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 _
from horizon import views from horizon import views

View File

@ -10,7 +10,7 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # 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 exceptions
from horizon import forms from horizon import forms

View File

@ -12,7 +12,7 @@
import logging import logging
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
import horizon import horizon

View File

@ -11,8 +11,8 @@
# under the License. # under the License.
from django.template import defaultfilters as filters from django.template import defaultfilters as filters
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
@ -25,7 +25,7 @@ class DeleteAggregateAction(tables.DeleteAction):
@staticmethod @staticmethod
def action_present(count): def action_present(count):
return ungettext_lazy( return ngettext_lazy(
"Delete Host Aggregate", "Delete Host Aggregate",
"Delete Host Aggregates", "Delete Host Aggregates",
count count
@ -33,7 +33,7 @@ class DeleteAggregateAction(tables.DeleteAction):
@staticmethod @staticmethod
def action_past(count): def action_past(count):
return ungettext_lazy( return ngettext_lazy(
"Deleted Host Aggregate", "Deleted Host Aggregate",
"Deleted Host Aggregates", "Deleted Host Aggregates",
count count

View File

@ -11,7 +11,7 @@
# under the License. # under the License.
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

@ -10,7 +10,7 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # 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 exceptions
from horizon import forms from horizon import forms

View File

@ -11,7 +11,7 @@
# under the License. # 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

@ -10,8 +10,8 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # 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
@ -41,7 +41,7 @@ class ForceDeleteBackup(policy.PolicyTargetMixin, tables.DeleteAction):
@staticmethod @staticmethod
def action_present(count): def action_present(count):
return ungettext_lazy( return ngettext_lazy(
"Force Delete Volume Backup", "Force Delete Volume Backup",
"Force Delete Volume Backups", "Force Delete Volume Backups",
count count
@ -49,7 +49,7 @@ class ForceDeleteBackup(policy.PolicyTargetMixin, tables.DeleteAction):
@staticmethod @staticmethod
def action_past(count): def action_past(count):
return ungettext_lazy( return ngettext_lazy(
"Scheduled forced deletion of Volume Backup", "Scheduled forced deletion of Volume Backup",
"Scheduled forced deletion of Volume Backups", "Scheduled forced deletion of Volume Backups",
count count

View File

@ -14,7 +14,7 @@ import logging
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 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from openstack_auth import utils from openstack_auth import utils
import horizon import horizon

View File

@ -12,7 +12,7 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # 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

@ -14,7 +14,7 @@
from django.urls import reverse from django.urls import reverse
from django.utils.http import urlencode from django.utils.http import urlencode
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from horizon import tables from horizon import tables

View File

@ -12,7 +12,7 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # 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 exceptions
from horizon import tabs from horizon import tabs

View File

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

View File

@ -14,7 +14,7 @@
import logging import logging
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

@ -16,7 +16,7 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # 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

@ -19,8 +19,8 @@
from django.template import defaultfilters as filters from django.template import defaultfilters as filters
from django.urls import reverse from django.urls import reverse
from django.utils.http import urlencode from django.utils.http import urlencode
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.templatetags import sizeformat from horizon.templatetags import sizeformat
@ -33,7 +33,7 @@ class DeleteFlavor(tables.DeleteAction):
@staticmethod @staticmethod
def action_present(count): def action_present(count):
return ungettext_lazy( return ngettext_lazy(
"Delete Flavor", "Delete Flavor",
"Delete Flavors", "Delete Flavors",
count count
@ -41,7 +41,7 @@ class DeleteFlavor(tables.DeleteAction):
@staticmethod @staticmethod
def action_past(count): def action_past(count):
return ungettext_lazy( return ngettext_lazy(
"Deleted Flavor", "Deleted Flavor",
"Deleted Flavors", "Deleted Flavors",
count count

View File

@ -17,7 +17,7 @@
# under the License. # under the License.
from django.conf.urls import url from django.conf.urls import url
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from horizon.browsers.views import AngularIndexView from horizon.browsers.views import AngularIndexView
from openstack_dashboard.dashboards.admin.flavors import views from openstack_dashboard.dashboards.admin.flavors import views

View File

@ -17,7 +17,7 @@
# under the License. # under the License.
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 tables from horizon import tables

View File

@ -17,7 +17,7 @@
# under the License. # 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 exceptions
from horizon import forms from horizon import forms

View File

@ -14,7 +14,7 @@
# under the License. # 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

@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # 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

@ -16,7 +16,7 @@
import logging import logging
from django import shortcuts from django import shortcuts
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 messages from horizon import messages

View File

@ -17,7 +17,7 @@ from collections import OrderedDict
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 _
import netaddr import netaddr
from horizon import exceptions from horizon import exceptions

View File

@ -12,7 +12,7 @@
from django.forms import ValidationError from django.forms import ValidationError
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

@ -10,7 +10,7 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # 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,7 +13,7 @@
import re import re
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

@ -13,8 +13,8 @@
from urllib import parse from urllib import parse
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
@ -25,7 +25,7 @@ class GroupTypeSpecDelete(tables.DeleteAction):
@staticmethod @staticmethod
def action_present(count): def action_present(count):
return ungettext_lazy( return ngettext_lazy(
"Delete Spec", "Delete Spec",
"Delete Specs", "Delete Specs",
count count
@ -33,7 +33,7 @@ class GroupTypeSpecDelete(tables.DeleteAction):
@staticmethod @staticmethod
def action_past(count): def action_past(count):
return ungettext_lazy( return ngettext_lazy(
"Delete Spec", "Delete Spec",
"Delete Specs", "Delete Specs",
count count

View File

@ -12,7 +12,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 horizon import exceptions from horizon import exceptions
from horizon import forms from horizon import forms

View File

@ -13,8 +13,8 @@
from django.template import defaultfilters as filters from django.template import defaultfilters as filters
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 exceptions from horizon import exceptions
from horizon import forms from horizon import forms
@ -62,7 +62,7 @@ class GroupTypesFilterAction(tables.FilterAction):
class DeleteGroupType(tables.DeleteAction): class DeleteGroupType(tables.DeleteAction):
@staticmethod @staticmethod
def action_present(count): def action_present(count):
return ungettext_lazy( return ngettext_lazy(
"Delete Group Type", "Delete Group Type",
"Delete Group Types", "Delete Group Types",
count count
@ -70,7 +70,7 @@ class DeleteGroupType(tables.DeleteAction):
@staticmethod @staticmethod
def action_past(count): def action_past(count):
return ungettext_lazy( return ngettext_lazy(
"Deleted Group Type", "Deleted Group Type",
"Deleted Group Types", "Deleted Group Types",
count count

View File

@ -12,7 +12,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 horizon import exceptions from horizon import exceptions
from horizon import forms from horizon import forms

View File

@ -11,7 +11,7 @@
# under the License. # 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

@ -11,9 +11,9 @@
# under the License. # under the License.
from django.template import defaultfilters as filters from django.template import defaultfilters as filters
from django.utils.translation import gettext_lazy as _
from django.utils.translation import ngettext_lazy
from django.utils.translation import pgettext_lazy from django.utils.translation import pgettext_lazy
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import ungettext_lazy
from horizon import tables from horizon import tables
from horizon.utils import filters as utils_filters from horizon.utils import filters as utils_filters
@ -54,7 +54,7 @@ class EnableService(policy.PolicyTargetMixin, tables.BatchAction):
@staticmethod @staticmethod
def action_present(count): def action_present(count):
return ungettext_lazy( return ngettext_lazy(
"Enable Service", "Enable Service",
"Enable Services", "Enable Services",
count count
@ -62,7 +62,7 @@ class EnableService(policy.PolicyTargetMixin, tables.BatchAction):
@staticmethod @staticmethod
def action_past(count): def action_past(count):
return ungettext_lazy( return ngettext_lazy(
"Enabled Service", "Enabled Service",
"Enabled Services", "Enabled Services",
count count

View File

@ -10,7 +10,7 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # 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 exceptions
from horizon import tabs from horizon import tabs

View File

@ -12,7 +12,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 horizon import exceptions from horizon import exceptions
from horizon import forms from horizon import forms

View File

@ -12,7 +12,7 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # 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 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from horizon import tables from horizon import tables
from horizon.templatetags import sizeformat from horizon.templatetags import sizeformat

View File

@ -10,7 +10,7 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # 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 exceptions
from horizon import tabs from horizon import tabs

View File

@ -12,7 +12,7 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # 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 exceptions
from horizon import tables from horizon import tables

View File

@ -16,7 +16,7 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # 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 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # 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 exceptions
from horizon import tables from horizon import tables

View File

@ -17,7 +17,7 @@
# under the License. # under the License.
from django.conf.urls import url from django.conf.urls import url
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from horizon.browsers.views import AngularIndexView from horizon.browsers.views import AngularIndexView
from openstack_dashboard.dashboards.admin.images import views from openstack_dashboard.dashboards.admin.images import views

View File

@ -23,7 +23,7 @@ from oslo_utils import units
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 messages from horizon import messages

View File

@ -16,7 +16,7 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # 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 @@
from django import template from django import template
from django.template import defaultfilters as filters from django.template import defaultfilters as filters
from django import urls from django import urls
from django.utils.translation import gettext_lazy as _
from django.utils.translation import pgettext_lazy from django.utils.translation import pgettext_lazy
from django.utils.translation import ugettext_lazy as _
from horizon import tables from horizon import tables
from horizon.utils import filters as utils_filters from horizon.utils import filters as utils_filters

View File

@ -12,7 +12,7 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # 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 exceptions
from horizon import tabs from horizon import tabs

View File

@ -16,7 +16,7 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # 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 exceptions
from horizon import tabs from horizon import tabs

View File

@ -14,7 +14,7 @@
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

@ -16,7 +16,7 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # 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

@ -15,8 +15,8 @@
from django.template.defaultfilters import title from django.template.defaultfilters import title
from django import urls from django import urls
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 keystoneclient import exceptions as keystone_exceptions from keystoneclient import exceptions as keystone_exceptions
from horizon import tables from horizon import tables
@ -55,7 +55,7 @@ class MigrateInstance(policy.PolicyTargetMixin, tables.BatchAction):
@staticmethod @staticmethod
def action_present(count): def action_present(count):
return ungettext_lazy( return ngettext_lazy(
"Migrate Instance", "Migrate Instance",
"Migrate Instances", "Migrate Instances",
count count
@ -63,7 +63,7 @@ class MigrateInstance(policy.PolicyTargetMixin, tables.BatchAction):
@staticmethod @staticmethod
def action_past(count): def action_past(count):
return ungettext_lazy( return ngettext_lazy(
"Scheduled migration (pending confirmation) of Instance", "Scheduled migration (pending confirmation) of Instance",
"Scheduled migration (pending confirmation) of Instances", "Scheduled migration (pending confirmation) of Instances",
count count

View File

@ -19,7 +19,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 horizon import exceptions from horizon import exceptions
from horizon import forms from horizon import forms

View File

@ -20,7 +20,7 @@ import json
from django.forms import ValidationError from django.forms import ValidationError
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

Some files were not shown because too many files have changed in this diff Show More