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:
@ -1,3 +1,4 @@
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
from netbox.registry import registry
|
||||
|
||||
__all__ = (
|
||||
@ -43,5 +44,7 @@ def register_table_column(column, name, *tables):
|
||||
for table in tables:
|
||||
reg = registry['tables'][table]
|
||||
if name in reg:
|
||||
raise ValueError(f"A column named {name} is already defined for table {table.__name__}")
|
||||
raise ValueError(_("A column named {name} is already defined for table {table_name}").format(
|
||||
name=name, table_name=table.__name__
|
||||
))
|
||||
reg[name] = column
|
||||
|
Reference in New Issue
Block a user