Make the values of Cluster status be translatable

Add STATUS_DISPLAY_CHOICES in files:
openstack_dashboard/dashboards/project/data_processing/clusters/tables.py

Change-Id: Ife20ff8768baa094aaa6ec4cceb974b9e0c89615
Partial-Bug: #1418027
This commit is contained in:
Wu Wenxiang 2015-02-04 23:25:03 +08:00
parent 5ad0db93f0
commit 25c9e2d66b
1 changed files with 7 additions and 1 deletions

View File

@ -14,6 +14,7 @@
import logging
from django.http import Http404 # noqa
from django.utils.translation import pgettext_lazy
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import ungettext_lazy
@ -100,6 +101,10 @@ class ClustersTable(tables.DataTable):
("active", True),
("error", False)
)
STATUS_DISPLAY_CHOICES = (
("active", pgettext_lazy("Current status of a Cluster", u"Active")),
("error", pgettext_lazy("Current status of a Cluster", u"Error")),
)
name = tables.Column("name",
verbose_name=_("Name"),
@ -108,7 +113,8 @@ class ClustersTable(tables.DataTable):
status = tables.Column("status",
verbose_name=_("Status"),
status=True,
status_choices=STATUS_CHOICES)
status_choices=STATUS_CHOICES,
display_choices=STATUS_DISPLAY_CHOICES)
instances_count = tables.Column(get_instances_count,
verbose_name=_("Instances Count"))