Skip to content

Commit ed366c5

Browse files
committed
Closes #11214: Introduce the DEFAULT_LANGUAGE configuration parameter
1 parent 2738da2 commit ed366c5

File tree

4 files changed

+16
-3
lines changed

4 files changed

+16
-3
lines changed

docs/configuration/system.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,17 @@ BASE_PATH = 'netbox/'
1212

1313
---
1414

15+
## DEFAULT_LANGUAGE
16+
17+
Default: `en-us` (US English)
18+
19+
Defines the default preferred language/locale for requests that do not specify one. This is used to alter e.g. the display of dates and numbers to fit the user's locale. See [this list](http://www.i18nguy.com/unicode/language-identifiers.html) of standard language codes. (This parameter maps to Django's [`LANGUAGE_CODE`](https://docs.djangoproject.com/en/stable/ref/settings/#language-code) internal setting.)
20+
21+
!!! note
22+
Altering this parameter will *not* change the language used in NetBox. We hope to provide translation support in a future NetBox release.
23+
24+
---
25+
1526
## DOCS_ROOT
1627

1728
Default: `$INSTALL_ROOT/docs/`

docs/release-notes/version-3.4.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
### Enhancements
66

77
* [#9971](https://github.com/netbox-community/netbox/issues/9971) - Enable ordering of nested group models by name
8+
* [#11214](https://github.com/netbox-community/netbox/issues/11214) - Introduce the `DEFAULT_LANGUAGE` configuration parameter
89

910
### Bug Fixes
1011

netbox/netbox/configuration_example.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@
106106
# on a production system.
107107
DEBUG = False
108108

109+
# Set the default preferred language/locale
110+
DEFAULT_LANGUAGE = 'en-us'
111+
109112
# Email settings
110113
EMAIL = {
111114
'SERVER': 'localhost',

netbox/netbox/settings.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@
9494
HTTP_PROXIES = getattr(configuration, 'HTTP_PROXIES', None)
9595
INTERNAL_IPS = getattr(configuration, 'INTERNAL_IPS', ('127.0.0.1', '::1'))
9696
JINJA2_FILTERS = getattr(configuration, 'JINJA2_FILTERS', {})
97+
LANGUAGE_CODE = getattr(configuration, 'DEFAULT_LANGUAGE', 'en-us')
9798
LOGGING = getattr(configuration, 'LOGGING', {})
9899
LOGIN_PERSISTENCE = getattr(configuration, 'LOGIN_PERSISTENCE', False)
99100
LOGIN_REQUIRED = getattr(configuration, 'LOGIN_REQUIRED', False)
@@ -386,9 +387,6 @@ def _setting(name, default=None):
386387
'netbox.authentication.ObjectPermissionBackend',
387388
]
388389

389-
# Internationalization
390-
LANGUAGE_CODE = 'en-us'
391-
392390
# Time zones
393391
USE_TZ = True
394392

0 commit comments

Comments
 (0)