mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-26 01:06:11 -06:00
11271 flag to disable localization
This commit is contained in:
parent
735fa4aa31
commit
fb112d5be1
@ -222,6 +222,9 @@ SESSION_COOKIE_NAME = 'sessionid'
|
||||
# database access.) Note that the user as which NetBox runs must have read and write permissions to this path.
|
||||
SESSION_FILE_PATH = None
|
||||
|
||||
# Localization
|
||||
ENABLE_LOCALIZATION = False
|
||||
|
||||
# Time zone (default: UTC)
|
||||
TIME_ZONE = 'UTC'
|
||||
|
||||
|
@ -137,6 +137,7 @@ STORAGE_BACKEND = getattr(configuration, 'STORAGE_BACKEND', None)
|
||||
STORAGE_CONFIG = getattr(configuration, 'STORAGE_CONFIG', {})
|
||||
TIME_FORMAT = getattr(configuration, 'TIME_FORMAT', 'g:i a')
|
||||
TIME_ZONE = getattr(configuration, 'TIME_ZONE', 'UTC')
|
||||
ENABLE_LOCALIZATION = getattr(configuration, 'ENABLE_LOCALIZATION', False)
|
||||
|
||||
# Check for hard-coded dynamic config parameters
|
||||
for param in PARAMS:
|
||||
@ -340,7 +341,14 @@ MIDDLEWARE = [
|
||||
'django_prometheus.middleware.PrometheusBeforeMiddleware',
|
||||
'corsheaders.middleware.CorsMiddleware',
|
||||
'django.contrib.sessions.middleware.SessionMiddleware',
|
||||
]
|
||||
|
||||
if ENABLE_LOCALIZATION:
|
||||
MIDDLEWARE.extend([
|
||||
'django.middleware.locale.LocaleMiddleware',
|
||||
])
|
||||
|
||||
MIDDLEWARE.extend([
|
||||
'django.middleware.common.CommonMiddleware',
|
||||
'django.middleware.csrf.CsrfViewMiddleware',
|
||||
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
||||
@ -354,7 +362,7 @@ MIDDLEWARE = [
|
||||
'netbox.middleware.APIVersionMiddleware',
|
||||
'netbox.middleware.ObjectChangeMiddleware',
|
||||
'django_prometheus.middleware.PrometheusAfterMiddleware',
|
||||
]
|
||||
])
|
||||
|
||||
ROOT_URLCONF = 'netbox.urls'
|
||||
|
||||
@ -651,6 +659,13 @@ RQ_QUEUES.update({
|
||||
queue: RQ_PARAMS for queue in set(QUEUE_MAPPINGS.values()) if queue not in RQ_QUEUES
|
||||
})
|
||||
|
||||
#
|
||||
# Localization
|
||||
#
|
||||
|
||||
if not ENABLE_LOCALIZATION:
|
||||
USE_I18N = False
|
||||
USE_L10N = False
|
||||
|
||||
#
|
||||
# Plugins
|
||||
|
Loading…
Reference in New Issue
Block a user