mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-14 09:51:22 -06:00

* add USE_I18N setting * change setting name to ENABLE_TRANSLATION * raise a warning in the UI when translation is disabled * Misc cleanup * Rename to TRANSLATION_ENABLED for consistency with other settings --------- Co-authored-by: Anton Myasnikov <anton.myasnikov@nordigy.ru> Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
12 lines
414 B
Python
12 lines
414 B
Python
class UserPreference:
|
|
"""
|
|
Represents a configurable user preference.
|
|
"""
|
|
def __init__(self, label, choices, default=None, description='', coerce=lambda x: x, warning=''):
|
|
self.label = label
|
|
self.choices = choices
|
|
self.default = default if default is not None else choices[0]
|
|
self.description = description
|
|
self.coerce = coerce
|
|
self.warning = warning
|