From cefbbd4608611efcf74ecd95321022949a622b3f Mon Sep 17 00:00:00 2001 From: Masco Kaliyamoorthy Date: Wed, 11 Feb 2015 14:47:47 +0530 Subject: [PATCH] made interface status value translatable in the interface table the value of status column is not translatable. this patch adding a display choices tuple with translatable option. Change-Id: I27f433ebbf4a1c8859024e4379ac1b7322de6cba Closes-Bug: #1420683 --- .../dashboards/project/routers/ports/tables.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/openstack_dashboard/dashboards/project/routers/ports/tables.py b/openstack_dashboard/dashboards/project/routers/ports/tables.py index 16462e190a..24610cceb8 100644 --- a/openstack_dashboard/dashboards/project/routers/ports/tables.py +++ b/openstack_dashboard/dashboards/project/routers/ports/tables.py @@ -94,6 +94,12 @@ DISPLAY_CHOICES = ( ("UP", pgettext_lazy("Admin state of a Port", u"UP")), ("DOWN", pgettext_lazy("Admin state of a Port", u"DOWN")), ) +STATUS_DISPLAY_CHOICES = ( + ("ACTIVE", pgettext_lazy("current status of port", u"Active")), + ("BUILD", pgettext_lazy("current status of port", u"Build")), + ("DOWN", pgettext_lazy("current status of port", u"Down")), + ("ERROR", pgettext_lazy("current status of port", u"Error")), +) class PortsTable(tables.DataTable): @@ -102,7 +108,9 @@ class PortsTable(tables.DataTable): link="horizon:project:networks:ports:detail") fixed_ips = tables.Column(project_tables.get_fixed_ips, verbose_name=_("Fixed IPs")) - status = tables.Column("status", verbose_name=_("Status")) + status = tables.Column("status", + verbose_name=_("Status"), + display_choices=STATUS_DISPLAY_CHOICES) device_owner = tables.Column(get_device_owner, verbose_name=_("Type")) admin_state = tables.Column("admin_state",