From 794ba46d563a0c039ddff017481403954f04d2a4 Mon Sep 17 00:00:00 2001 From: David Lyle Date: Wed, 3 Dec 2014 10:07:23 -0700 Subject: [PATCH] Standardizing translation of "-" There are several places where "-" or '-' are not translated strings. There are others where they are. This should be consistent. I can see value in being able to translate "-" to another character. Closes-Bug: #1398892 Change-Id: Icfcd20fb597122d8efa30debf9f6e7273f036419 --- horizon/tables/base.py | 2 +- openstack_dashboard/api/nova.py | 4 ++-- .../project/access_and_security/floating_ips/tables.py | 4 ++-- .../instances/templates/instances/_detail_overview.html | 4 ++-- .../networks/templates/networks/_detail_overview.html | 6 +++--- .../networks/templates/networks/ports/_detail_overview.html | 4 ++-- .../templates/networks/subnets/_detail_overview.html | 4 ++-- openstack_dashboard/dashboards/project/routers/tables.py | 2 +- .../dashboards/project/volumes/volumes/tables.py | 4 ++-- 9 files changed, 17 insertions(+), 17 deletions(-) diff --git a/horizon/tables/base.py b/horizon/tables/base.py index 965e266564..a5589f56a7 100644 --- a/horizon/tables/base.py +++ b/horizon/tables/base.py @@ -302,7 +302,7 @@ class Column(html.HTMLElement): self.allowed_data_types = allowed_data_types self.hidden = hidden self.status = status - self.empty_value = empty_value or '-' + self.empty_value = empty_value or _('-') self.filters = filters or [] self.truncate = truncate self.wrap_list = wrap_list diff --git a/openstack_dashboard/api/nova.py b/openstack_dashboard/api/nova.py index ed74120a4e..71f9718e19 100644 --- a/openstack_dashboard/api/nova.py +++ b/openstack_dashboard/api/nova.py @@ -99,7 +99,7 @@ class Server(base.APIResourceWrapper): from openstack_dashboard.api import glance # noqa if not self.image: - return "-" + return _("-") if hasattr(self.image, 'name'): return self.image.name if 'name' in self.image: @@ -109,7 +109,7 @@ class Server(base.APIResourceWrapper): image = glance.image_get(self.request, self.image['id']) return image.name except glance_exceptions.ClientException: - return "-" + return _("-") @property def internal_name(self): diff --git a/openstack_dashboard/dashboards/project/access_and_security/floating_ips/tables.py b/openstack_dashboard/dashboards/project/access_and_security/floating_ips/tables.py index 65eb830ee4..55b3f83c07 100644 --- a/openstack_dashboard/dashboards/project/access_and_security/floating_ips/tables.py +++ b/openstack_dashboard/dashboards/project/access_and_security/floating_ips/tables.py @@ -194,10 +194,10 @@ class FloatingIPsTable(tables.DataTable): fixed_ip = tables.Column(get_instance_info, link=get_instance_link, verbose_name=_("Mapped Fixed IP Address"), - empty_value="-") + empty_value=_("-")) pool = tables.Column("pool_name", verbose_name=_("Pool"), - empty_value="-") + empty_value=_("-")) status = tables.Column("status", verbose_name=_("Status"), status=True, diff --git a/openstack_dashboard/dashboards/project/instances/templates/instances/_detail_overview.html b/openstack_dashboard/dashboards/project/instances/templates/instances/_detail_overview.html index 38003eaf1f..9db438506d 100644 --- a/openstack_dashboard/dashboards/project/instances/templates/instances/_detail_overview.html +++ b/openstack_dashboard/dashboards/project/instances/templates/instances/_detail_overview.html @@ -14,13 +14,13 @@
{% trans "Status" %}
{{ instance.status_label|title }}
{% trans "Availability Zone" %}
-
{{ instance.availability_zone|default:"-" }}
+
{{ instance.availability_zone|default:_("-") }}
{% trans "Created" %}
{{ instance.created|parse_isotime }}
{% trans "Uptime" %}
{{ instance.created|parse_isotime|timesince }}
{% trans "Host" %}
-
{{ instance.host_server|default:"-" }}
+
{{ instance.host_server|default:_("-") }}
diff --git a/openstack_dashboard/dashboards/project/networks/templates/networks/_detail_overview.html b/openstack_dashboard/dashboards/project/networks/templates/networks/_detail_overview.html index f0afd21248..f0a9a027d3 100644 --- a/openstack_dashboard/dashboards/project/networks/templates/networks/_detail_overview.html +++ b/openstack_dashboard/dashboards/project/networks/templates/networks/_detail_overview.html @@ -9,7 +9,7 @@
{% trans "ID" %}
{{ network.id|default:_("None") }}
{% trans "Project ID" %}
-
{{ network.tenant_id|default:"-" }}
+
{{ network.tenant_id|default:_("-") }}
{% trans "Status" %}
{{ network.status|default:_("Unknown") }}
{% trans "Admin State" %}
@@ -21,8 +21,8 @@ {% if network.provider__network_type %}
{% trans "Provider Network" %}
{% trans "Network Type:" %} {{ network.provider__network_type|default:_("Unknown") }}
-
{% trans "Physical Network:" %} {{ network.provider__physical_network|default:"-" }}
-
{% trans "Segmentation ID:" %} {{ network.provider__segmentation_id|default:"-" }}
+
{% trans "Physical Network:" %} {{ network.provider__physical_network|default:_("-") }}
+
{% trans "Segmentation ID:" %} {{ network.provider__segmentation_id|default:_("-") }}
{% endif %} diff --git a/openstack_dashboard/dashboards/project/networks/templates/networks/ports/_detail_overview.html b/openstack_dashboard/dashboards/project/networks/templates/networks/ports/_detail_overview.html index fc91a8135f..04895fccb7 100644 --- a/openstack_dashboard/dashboards/project/networks/templates/networks/ports/_detail_overview.html +++ b/openstack_dashboard/dashboards/project/networks/templates/networks/ports/_detail_overview.html @@ -15,7 +15,7 @@
{% trans "Network ID" %}
{{ port.network_id|default:_("None") }}
{% trans "Project ID" %}
-
{{ port.tenant_id|default:"-" }}
+
{{ port.tenant_id|default:_("-") }}
{% trans "Fixed IP" %}
{% if port.fixed_ips.items|length > 1 %} @@ -40,7 +40,7 @@
{% trans "Attached Device" %}
{% if port.device_id|length > 1 or port.device_owner %}
{% trans "Device Owner" %}: {{ port.device_owner|default:_("None") }}
-
{% trans "Device ID" %}: {{ port.device_id|default:"-" }}
+
{% trans "Device ID" %}: {{ port.device_id|default:_("-") }}
{% else %}
{% trans "No attached device" %}
{% endif %} diff --git a/openstack_dashboard/dashboards/project/networks/templates/networks/subnets/_detail_overview.html b/openstack_dashboard/dashboards/project/networks/templates/networks/subnets/_detail_overview.html index 60b147758c..6b05298e5a 100644 --- a/openstack_dashboard/dashboards/project/networks/templates/networks/subnets/_detail_overview.html +++ b/openstack_dashboard/dashboards/project/networks/templates/networks/subnets/_detail_overview.html @@ -14,7 +14,7 @@
{% trans "Network ID" %}
{{ subnet.network_id|default:_("None") }}
{% trans "IP version" %}
-
{{ subnet.ipver_str|default:"-" }}
+
{{ subnet.ipver_str|default:_("-") }}
{% trans "CIDR" %}
{{ subnet.cidr|default:_("None") }}
{% trans "IP allocation pool" %}
@@ -25,7 +25,7 @@ {% endfor %}
{% trans "Gateway IP" %}
-
{{ subnet.gateway_ip|default:"-" }}
+
{{ subnet.gateway_ip|default:_("-") }}
{% trans "DHCP Enable" %}
{{ subnet.enable_dhcp|yesno|capfirst }}
{% if subnet.ip_version == 6 %} diff --git a/openstack_dashboard/dashboards/project/routers/tables.py b/openstack_dashboard/dashboards/project/routers/tables.py index 41fecbeb6a..90914e68d8 100644 --- a/openstack_dashboard/dashboards/project/routers/tables.py +++ b/openstack_dashboard/dashboards/project/routers/tables.py @@ -179,7 +179,7 @@ def get_external_network(router): if router.external_gateway_info: return router.external_gateway_info['network'] else: - return "-" + return _("-") class RoutersTable(tables.DataTable): diff --git a/openstack_dashboard/dashboards/project/volumes/volumes/tables.py b/openstack_dashboard/dashboards/project/volumes/volumes/tables.py index 8e316b931a..d18a3ebab3 100644 --- a/openstack_dashboard/dashboards/project/volumes/volumes/tables.py +++ b/openstack_dashboard/dashboards/project/volumes/volumes/tables.py @@ -304,7 +304,7 @@ def get_volume_type(volume): def get_encrypted_value(volume): if not hasattr(volume, 'encrypted') or volume.encrypted is None: - return "-" + return _("-") elif volume.encrypted is False: return _("No") else: @@ -353,7 +353,7 @@ class VolumesTable(VolumesTableBase): link="horizon:project:volumes:volumes:detail") volume_type = tables.Column(get_volume_type, verbose_name=_("Type"), - empty_value="-") + empty_value=_("-")) attachments = AttachmentColumn("attachments", verbose_name=_("Attached To")) availability_zone = tables.Column("availability_zone",