mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
15094 Add missing gettext to error strings for internationalization (#15155)
* 15049 add missing gettext to error strings * 15049 add missing gettext to error strings * 15094 review change * 15094 review change * Formatting cleanup --------- Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
This commit is contained in:
@ -2,6 +2,7 @@ import re
|
||||
|
||||
from django.core.exceptions import ValidationError
|
||||
from django.core.validators import BaseValidator, RegexValidator, URLValidator, _lazy_re_compile
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
from netbox.config import get_config
|
||||
|
||||
@ -61,4 +62,4 @@ def validate_regex(value):
|
||||
try:
|
||||
re.compile(value)
|
||||
except re.error:
|
||||
raise ValidationError(f"{value} is not a valid regular expression.")
|
||||
raise ValidationError(_("{value} is not a valid regular expression.").format(value=value))
|
||||
|
Reference in New Issue
Block a user