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:
parent
a9d5273f3c
commit
cd7c1b5110
@ -176,7 +176,7 @@ The standard installation uses a non-encrypted HTTP channel.
|
||||
|
||||
import os
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
DEBUG = False
|
||||
TEMPLATE_DEBUG = DEBUG
|
||||
|
@ -112,7 +112,7 @@ module in dotted python path notation. Example::
|
||||
You can do essentially anything you like in the customization module. For
|
||||
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
|
||||
|
||||
@ -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
|
||||
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 tables
|
||||
|
@ -119,9 +119,9 @@ scenarios, such as interpolation, contextual markers and translation comments.
|
||||
|
||||
.. 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 ugettext as _
|
||||
from django.utils.translation import ungettext
|
||||
|
||||
class IndexView(request):
|
||||
|
||||
@ -129,7 +129,7 @@ scenarios, such as interpolation, contextual markers and translation comments.
|
||||
_("Images")
|
||||
|
||||
# Plural example
|
||||
ungettext(
|
||||
ngettext(
|
||||
"there is %(count)d object",
|
||||
"there are %(count)d objects",
|
||||
count) % { "count": count }
|
||||
@ -142,11 +142,11 @@ scenarios, such as interpolation, contextual markers and translation comments.
|
||||
pgettext("the month name", "May")
|
||||
|
||||
# Translators: This message appears as a comment for translators!
|
||||
ugettext("Welcome translators.")
|
||||
gettext("Welcome translators.")
|
||||
|
||||
.. 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.
|
||||
|
||||
In Django templates
|
||||
|
@ -93,7 +93,7 @@ Defining a dashboard
|
||||
Open the ``dashboard.py`` file. You will notice the following code has been
|
||||
automatically generated::
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
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::
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
import horizon
|
||||
|
||||
@ -199,7 +199,7 @@ the default panel::
|
||||
The completed ``dashboard.py`` file should look like
|
||||
the following::
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
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
|
||||
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
|
||||
|
||||
@ -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::
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
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::
|
||||
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
from horizon import exceptions
|
||||
from horizon import tabs
|
||||
|
@ -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
|
||||
your enabled file.::
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
import horizon
|
||||
|
||||
|
||||
|
@ -69,7 +69,7 @@ Create the ``forms.py`` file under the ``mypanel`` directory and add the
|
||||
following::
|
||||
|
||||
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 forms
|
||||
@ -107,7 +107,7 @@ file should now look something like this::
|
||||
|
||||
from django.urls import reverse
|
||||
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 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::
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
from horizon import tables
|
||||
|
||||
|
@ -37,7 +37,7 @@ from django.urls import reverse
|
||||
from django.utils.functional import empty
|
||||
from django.utils.functional import SimpleLazyObject
|
||||
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.decorators import _current_component
|
||||
|
@ -13,7 +13,7 @@
|
||||
# under the License.
|
||||
|
||||
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.tables import DataTable
|
||||
|
@ -13,7 +13,7 @@
|
||||
# under the License.
|
||||
|
||||
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
|
||||
|
||||
import horizon
|
||||
|
@ -11,7 +11,7 @@
|
||||
# under the License.
|
||||
|
||||
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.
|
||||
HORIZON_CONFIG = {
|
||||
|
@ -21,7 +21,7 @@ General-purpose decorators for use with Horizon.
|
||||
"""
|
||||
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):
|
||||
|
@ -11,7 +11,7 @@
|
||||
# under the License.
|
||||
|
||||
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
|
||||
|
||||
|
@ -23,7 +23,7 @@ import sys
|
||||
from debtcollector import removals
|
||||
from django.core.management import color_style
|
||||
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 horizon.conf import HORIZON_CONFIG
|
||||
|
@ -31,7 +31,7 @@ from django.utils.encoding import force_str
|
||||
from django.utils.functional import Promise
|
||||
from django.utils import html
|
||||
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:/\.]+$')
|
||||
IPv4 = 1
|
||||
|
@ -17,7 +17,7 @@ import os
|
||||
|
||||
from django.conf import settings
|
||||
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 views
|
||||
|
@ -18,7 +18,7 @@ import logging
|
||||
import os
|
||||
|
||||
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 messages
|
||||
|
@ -25,7 +25,7 @@ from django.template.loader import render_to_string
|
||||
from django import urls
|
||||
from django.utils.functional import Promise
|
||||
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 messages
|
||||
|
@ -36,7 +36,7 @@ from django.utils import http
|
||||
from django.utils.http import urlencode
|
||||
from django.utils.safestring import mark_safe
|
||||
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 exceptions
|
||||
|
@ -19,7 +19,7 @@ from django import template
|
||||
from django.template import Node
|
||||
from django.utils.encoding import force_str
|
||||
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 import conf
|
||||
|
@ -24,8 +24,8 @@ from oslo_utils import units
|
||||
|
||||
from django import template
|
||||
from django.utils import formats
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.utils.translation import ungettext_lazy
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
from django.utils.translation import ngettext_lazy
|
||||
|
||||
|
||||
register = template.Library()
|
||||
@ -48,15 +48,15 @@ def filesizeformat(bytes, filesize_number_format):
|
||||
try:
|
||||
bytes = float(bytes)
|
||||
except (TypeError, ValueError, UnicodeDecodeError):
|
||||
return ungettext_lazy("%(size)d B",
|
||||
"%(size)d B", 0) % {'size': 0}
|
||||
return ngettext_lazy("%(size)d B",
|
||||
"%(size)d B", 0) % {'size': 0}
|
||||
|
||||
if bytes == float('inf'):
|
||||
return _('Infinity')
|
||||
if bytes < units.Ki:
|
||||
bytes = int(bytes)
|
||||
return ungettext_lazy("%(size)d B",
|
||||
"%(size)d B", bytes) % {'size': bytes}
|
||||
return ngettext_lazy("%(size)d B",
|
||||
"%(size)d B", bytes) % {'size': bytes}
|
||||
if bytes < units.Mi:
|
||||
return _("%s KB") % filesize_number_format(bytes / units.Ki)
|
||||
if bytes < units.Gi:
|
||||
|
@ -10,7 +10,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from django.utils.translation import ungettext_lazy
|
||||
from django.utils.translation import ngettext_lazy
|
||||
|
||||
from horizon import tables
|
||||
|
||||
@ -27,7 +27,7 @@ class SellPuppy(tables.DeleteAction):
|
||||
@staticmethod
|
||||
def action_present(count):
|
||||
# Translators: test code, don't really have to translate
|
||||
return ungettext_lazy(
|
||||
return ngettext_lazy(
|
||||
"Sell Puppy",
|
||||
"Sell Puppies",
|
||||
count
|
||||
@ -36,7 +36,7 @@ class SellPuppy(tables.DeleteAction):
|
||||
@staticmethod
|
||||
def action_past(count):
|
||||
# Translators: test code, don't really have to translate
|
||||
return ungettext_lazy(
|
||||
return ngettext_lazy(
|
||||
"Sold Puppy",
|
||||
"Sold Puppies",
|
||||
count
|
||||
|
@ -25,7 +25,7 @@ from django import shortcuts
|
||||
from django.template import defaultfilters
|
||||
from django.test.utils import override_settings
|
||||
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 tables
|
||||
@ -157,7 +157,7 @@ class MyBatchAction(tables.BatchAction):
|
||||
@staticmethod
|
||||
def action_present(count):
|
||||
# Translators: test code, don't really have to translate
|
||||
return ungettext_lazy(
|
||||
return ngettext_lazy(
|
||||
"Batch Item",
|
||||
"Batch Items",
|
||||
count
|
||||
@ -166,7 +166,7 @@ class MyBatchAction(tables.BatchAction):
|
||||
@staticmethod
|
||||
def action_past(count):
|
||||
# Translators: test code, don't really have to translate
|
||||
return ungettext_lazy(
|
||||
return ngettext_lazy(
|
||||
"Batched Item",
|
||||
"Batched Items",
|
||||
count
|
||||
@ -194,14 +194,14 @@ class MyToggleAction(tables.BatchAction):
|
||||
def action_present(self, count):
|
||||
if self.current_present_action:
|
||||
# Translators: test code, don't really have to translate
|
||||
return ungettext_lazy(
|
||||
return ngettext_lazy(
|
||||
"Up Item",
|
||||
"Up Items",
|
||||
count
|
||||
)
|
||||
else:
|
||||
# Translators: test code, don't really have to translate
|
||||
return ungettext_lazy(
|
||||
return ngettext_lazy(
|
||||
"Down Item",
|
||||
"Down Items",
|
||||
count
|
||||
@ -210,14 +210,14 @@ class MyToggleAction(tables.BatchAction):
|
||||
def action_past(self, count):
|
||||
if self.current_past_action:
|
||||
# Translators: test code, don't really have to translate
|
||||
return ungettext_lazy(
|
||||
return ngettext_lazy(
|
||||
"Upped Item",
|
||||
"Upped Items",
|
||||
count
|
||||
)
|
||||
else:
|
||||
# Translators: test code, don't really have to translate
|
||||
return ungettext_lazy(
|
||||
return ngettext_lazy(
|
||||
"Downed Item",
|
||||
"Downed Items",
|
||||
count
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
from django import forms
|
||||
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 horizon.test import helpers as test
|
||||
|
@ -20,7 +20,7 @@ from django.template.defaultfilters import register
|
||||
from django.template.defaultfilters import timesince
|
||||
from django.utils.safestring import mark_safe
|
||||
from django.utils import timezone
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
|
||||
@register.filter
|
||||
|
@ -18,7 +18,7 @@ from oslo_utils import netutils
|
||||
|
||||
from django.core.exceptions import ValidationError
|
||||
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
|
||||
|
||||
|
@ -28,7 +28,7 @@ from django.template.defaultfilters import slugify
|
||||
from django import urls
|
||||
from django.utils.encoding import force_str
|
||||
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 horizon import base
|
||||
|
@ -20,7 +20,7 @@ import pytz
|
||||
|
||||
from django.conf import settings
|
||||
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 user as auth_user
|
||||
|
@ -18,7 +18,7 @@ from django.conf import settings
|
||||
from django.contrib.auth import authenticate
|
||||
from django.contrib.auth import forms as django_auth_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 keystoneauth1 import plugin as auth_plugin
|
||||
|
@ -14,7 +14,7 @@ import abc
|
||||
import logging
|
||||
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 keystoneclient.v3 import client as v3_client
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
import logging
|
||||
|
||||
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 openstack_auth import exceptions
|
||||
|
@ -24,7 +24,7 @@ from django.middleware import csrf
|
||||
from django import shortcuts
|
||||
from django.urls import reverse
|
||||
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.csrf import csrf_exempt
|
||||
from django.views.decorators.csrf import csrf_protect
|
||||
|
@ -22,8 +22,8 @@ import logging
|
||||
import math
|
||||
|
||||
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 ugettext_lazy as _
|
||||
|
||||
from cinderclient import api_versions
|
||||
from cinderclient import client as cinder_client
|
||||
|
@ -28,7 +28,7 @@ from django.conf import settings
|
||||
from django.core.files.uploadedfile import InMemoryUploadedFile
|
||||
from django.core.files.uploadedfile import SimpleUploadedFile
|
||||
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
|
||||
|
||||
|
@ -22,7 +22,7 @@ import logging
|
||||
from urllib import parse
|
||||
|
||||
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 token_endpoint
|
||||
|
@ -26,7 +26,7 @@ import logging
|
||||
import netaddr
|
||||
|
||||
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.v2_0 import client as neutron_client
|
||||
from novaclient import exceptions as nova_exc
|
||||
|
@ -22,7 +22,7 @@ import collections
|
||||
import logging
|
||||
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 exceptions as nova_exceptions
|
||||
|
@ -13,7 +13,7 @@
|
||||
# limitations under the License.
|
||||
"""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 openstack_dashboard import api
|
||||
|
@ -14,7 +14,7 @@
|
||||
import json
|
||||
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):
|
||||
|
@ -14,7 +14,7 @@
|
||||
# limitations under the License.
|
||||
"""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 openstack_dashboard import api
|
||||
|
@ -15,7 +15,7 @@
|
||||
from collections import OrderedDict
|
||||
|
||||
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 novaclient import exceptions
|
||||
|
||||
|
@ -24,7 +24,7 @@ import functools
|
||||
import swiftclient
|
||||
|
||||
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
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
# under the License.
|
||||
|
||||
from django.conf import settings
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
import horizon
|
||||
|
||||
|
@ -12,7 +12,7 @@
|
||||
# See the 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
|
||||
|
||||
|
@ -17,7 +17,7 @@ from django.conf import settings
|
||||
from django.core import exceptions
|
||||
from django.urls import reverse
|
||||
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 profiler
|
||||
from osprofiler import web
|
||||
|
@ -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
|
||||
from horizon.utils import settings as horizon_settings
|
||||
|
@ -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 _
|
||||
from django.views import generic
|
||||
|
||||
from horizon import views
|
||||
|
@ -12,7 +12,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
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
# See the 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
|
||||
|
||||
|
@ -12,7 +12,7 @@
|
||||
# See the 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 _
|
||||
|
||||
from horizon import views
|
||||
|
||||
|
@ -10,7 +10,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 _
|
||||
|
||||
from horizon import exceptions
|
||||
from horizon import forms
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
import logging
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
import horizon
|
||||
|
||||
|
@ -11,8 +11,8 @@
|
||||
# under the License.
|
||||
|
||||
from django.template import defaultfilters as filters
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.utils.translation import ungettext_lazy
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
from django.utils.translation import ngettext_lazy
|
||||
|
||||
from horizon import tables
|
||||
|
||||
@ -25,7 +25,7 @@ class DeleteAggregateAction(tables.DeleteAction):
|
||||
|
||||
@staticmethod
|
||||
def action_present(count):
|
||||
return ungettext_lazy(
|
||||
return ngettext_lazy(
|
||||
"Delete Host Aggregate",
|
||||
"Delete Host Aggregates",
|
||||
count
|
||||
@ -33,7 +33,7 @@ class DeleteAggregateAction(tables.DeleteAction):
|
||||
|
||||
@staticmethod
|
||||
def action_past(count):
|
||||
return ungettext_lazy(
|
||||
return ngettext_lazy(
|
||||
"Deleted Host Aggregate",
|
||||
"Deleted Host Aggregates",
|
||||
count
|
||||
|
@ -11,7 +11,7 @@
|
||||
# under the License.
|
||||
|
||||
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 forms
|
||||
|
@ -10,7 +10,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 _
|
||||
|
||||
from horizon import exceptions
|
||||
from horizon import forms
|
||||
|
@ -11,7 +11,7 @@
|
||||
# under the License.
|
||||
|
||||
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 forms
|
||||
|
@ -10,8 +10,8 @@
|
||||
# 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 ungettext_lazy
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
from django.utils.translation import ngettext_lazy
|
||||
|
||||
from horizon import exceptions
|
||||
from horizon import tables
|
||||
@ -41,7 +41,7 @@ class ForceDeleteBackup(policy.PolicyTargetMixin, tables.DeleteAction):
|
||||
|
||||
@staticmethod
|
||||
def action_present(count):
|
||||
return ungettext_lazy(
|
||||
return ngettext_lazy(
|
||||
"Force Delete Volume Backup",
|
||||
"Force Delete Volume Backups",
|
||||
count
|
||||
@ -49,7 +49,7 @@ class ForceDeleteBackup(policy.PolicyTargetMixin, tables.DeleteAction):
|
||||
|
||||
@staticmethod
|
||||
def action_past(count):
|
||||
return ungettext_lazy(
|
||||
return ngettext_lazy(
|
||||
"Scheduled forced deletion of Volume Backup",
|
||||
"Scheduled forced deletion of Volume Backups",
|
||||
count
|
||||
|
@ -14,7 +14,7 @@ import logging
|
||||
|
||||
from django.urls import reverse
|
||||
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 forms
|
||||
|
@ -12,7 +12,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 _
|
||||
from openstack_auth import utils
|
||||
|
||||
import horizon
|
||||
|
@ -12,7 +12,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,7 +14,7 @@
|
||||
|
||||
from django.urls import reverse
|
||||
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
|
||||
|
||||
|
@ -12,7 +12,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 _
|
||||
|
||||
from horizon import exceptions
|
||||
from horizon import tabs
|
||||
|
@ -12,7 +12,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 _
|
||||
|
||||
from horizon import tabs
|
||||
from horizon import workflows
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
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 forms
|
||||
|
@ -16,7 +16,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
|
||||
|
||||
|
@ -19,8 +19,8 @@
|
||||
from django.template import defaultfilters as filters
|
||||
from django.urls import reverse
|
||||
from django.utils.http import urlencode
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.utils.translation import ungettext_lazy
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
from django.utils.translation import ngettext_lazy
|
||||
|
||||
from horizon import tables
|
||||
from horizon.templatetags import sizeformat
|
||||
@ -33,7 +33,7 @@ class DeleteFlavor(tables.DeleteAction):
|
||||
|
||||
@staticmethod
|
||||
def action_present(count):
|
||||
return ungettext_lazy(
|
||||
return ngettext_lazy(
|
||||
"Delete Flavor",
|
||||
"Delete Flavors",
|
||||
count
|
||||
@ -41,7 +41,7 @@ class DeleteFlavor(tables.DeleteAction):
|
||||
|
||||
@staticmethod
|
||||
def action_past(count):
|
||||
return ungettext_lazy(
|
||||
return ngettext_lazy(
|
||||
"Deleted Flavor",
|
||||
"Deleted Flavors",
|
||||
count
|
||||
|
@ -17,7 +17,7 @@
|
||||
# under the License.
|
||||
|
||||
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 openstack_dashboard.dashboards.admin.flavors import views
|
||||
|
@ -17,7 +17,7 @@
|
||||
# under the License.
|
||||
|
||||
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 tables
|
||||
|
@ -17,7 +17,7 @@
|
||||
# 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 forms
|
||||
|
@ -14,7 +14,7 @@
|
||||
# under the License.
|
||||
|
||||
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 forms
|
||||
|
@ -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
|
||||
|
||||