From acfb83d5d5e45506cb2198869bc9e345f87ff6ea Mon Sep 17 00:00:00 2001 From: Julie Pichon Date: Fri, 17 May 2013 16:38:25 +0100 Subject: [PATCH] Mark additional strings as translatable Some variables and templates variables that should be translatable weren't marked as such. Fixes bug #1180316 Change-Id: I90baf19c4bea09c126f8ed225777037194f5331f --- .../common/_data_table_table_actions.html | 3 ++- .../horizon/common/_quota_summary.html | 20 ++++++++++++++----- .../dashboards/admin/routers/panel.py | 2 +- .../images_and_snapshots/images/tables.py | 6 +++--- .../instances/_launch_details_help.html | 2 +- .../dashboards/project/networks/workflows.py | 6 +++--- .../dashboards/project/routers/panel.py | 2 +- .../volumes/templates/volumes/_create.html | 4 ++-- 8 files changed, 28 insertions(+), 17 deletions(-) diff --git a/horizon/templates/horizon/common/_data_table_table_actions.html b/horizon/templates/horizon/common/_data_table_table_actions.html index 7892b413f..44b43f674 100644 --- a/horizon/templates/horizon/common/_data_table_table_actions.html +++ b/horizon/templates/horizon/common/_data_table_table_actions.html @@ -1,3 +1,4 @@ +{% load i18n %}
{% block table_filter %} {% if filter.filter_type == 'fixed' %} @@ -9,7 +10,7 @@ {% elif filter.filter_type == 'query' %} {% endif %} {% endblock table_filter %} diff --git a/horizon/templates/horizon/common/_quota_summary.html b/horizon/templates/horizon/common/_quota_summary.html index 02375dbb3..7ebbbc51d 100644 --- a/horizon/templates/horizon/common/_quota_summary.html +++ b/horizon/templates/horizon/common/_quota_summary.html @@ -4,27 +4,37 @@

{% trans "Quota Summary" %}

- {% trans "Available Instances" %}
{% trans "Used" %} {{ usage.quotas.instances.used|intcomma }} {% trans "of" %} {{ usage.quotas.instances.quota|intcomma }}
+ {% trans "Available Instances" %}
+ {% blocktrans with used=usage.quotas.instances.used|intcomma available=usage.quotas.instances.quota|intcomma %}Used {{ used }} of {{ available }} {% endblocktrans %} +
- {% trans "Available VCPUs" %}
{% trans "Used" %} {{ usage.quotas.cores.used|intcomma }} {% trans "of" %} {{ usage.quotas.cores.quota|intcomma }}
+ {% trans "Available VCPUs" %}
+ {% blocktrans with used=usage.quotas.cores.used|intcomma available=usage.quotas.cores.quota|intcomma %}Used {{ used }} of {{ available }} {% endblocktrans %} +
- {% trans "Available RAM" %}
{% trans "Used" %} {{ usage.quotas.ram.used|intcomma }} MB {% trans "of" %} {{ usage.quotas.ram.quota|intcomma }} MB
+ {% trans "Available RAM" %}
+ {% blocktrans with used=usage.quotas.ram.used|intcomma available=usage.quotas.ram.quota|intcomma %}Used {{ used }} MB of {{ available }} MB {% endblocktrans %} +
{% if usage.quotas.volumes %}
- {% trans "Available Volumes" %}
{% trans "Used" %} {{ usage.quotas.volumes.used|intcomma }} {% trans "of" %} {{ usage.quotas.volumes.quota|intcomma }}
+ {% trans "Available Volumes" %}
+ {% blocktrans with used=usage.quotas.volumes.used|intcomma available=usage.quotas.volumes.quota|intcomma %} Used {{ used }} of {{ available }} {% endblocktrans %} +
- {% trans "Available Volume Storage" %}
{% trans "Used" %} {{ usage.quotas.gigabytes.used|intcomma }} GB {% trans "of" %} {{ usage.quotas.gigabytes.quota|intcomma }} GB
+ {% trans "Available Volume Storage" %}
+ {% blocktrans with used=usage.quotas.gigabytes.used|intcomma available=usage.quotas.gigabytes.quota|intcomma%}Used {{ used }} GB of {{ available }} GB{% endblocktrans %} +
{% endif %}
diff --git a/openstack_dashboard/dashboards/admin/routers/panel.py b/openstack_dashboard/dashboards/admin/routers/panel.py index ccb9c996b..69709363f 100644 --- a/openstack_dashboard/dashboards/admin/routers/panel.py +++ b/openstack_dashboard/dashboards/admin/routers/panel.py @@ -22,7 +22,7 @@ from openstack_dashboard.dashboards.admin import dashboard class Routers(horizon.Panel): - name = "Routers" + name = _("Routers") slug = 'routers' permissions = ('openstack.services.network',) diff --git a/openstack_dashboard/dashboards/project/images_and_snapshots/images/tables.py b/openstack_dashboard/dashboards/project/images_and_snapshots/images/tables.py index 7ec89a429..7c1f2711d 100644 --- a/openstack_dashboard/dashboards/project/images_and_snapshots/images/tables.py +++ b/openstack_dashboard/dashboards/project/images_and_snapshots/images/tables.py @@ -115,13 +115,13 @@ class OwnerFilter(tables.FixedFilterAction): def make_dict(text, tenant, icon): return dict(text=text, value=tenant, icon=icon) - buttons = [make_dict('Project', 'project', 'icon-home')] + buttons = [make_dict(_('Project'), 'project', 'icon-home')] for button_dict in filter_tenants(): new_dict = button_dict.copy() new_dict['value'] = new_dict['tenant'] buttons.append(new_dict) - buttons.append(make_dict('Shared with Me', 'shared', 'icon-share')) - buttons.append(make_dict('Public', 'public', 'icon-fire')) + buttons.append(make_dict(_('Shared with Me'), 'shared', 'icon-share')) + buttons.append(make_dict(_('Public'), 'public', 'icon-fire')) return buttons def categorize(self, table, images): diff --git a/openstack_dashboard/dashboards/project/instances/templates/instances/_launch_details_help.html b/openstack_dashboard/dashboards/project/instances/templates/instances/_launch_details_help.html index ee7dfa8b6..2f89b9012 100644 --- a/openstack_dashboard/dashboards/project/instances/templates/instances/_launch_details_help.html +++ b/openstack_dashboard/dashboards/project/instances/templates/instances/_launch_details_help.html @@ -33,7 +33,7 @@
{% trans "Total RAM" %} ({{ usages.ram.used|intcomma }} {% trans "MB" %}) -

{{ usages.ram.available|quota:"MB"|intcomma }}

+

{{ usages.ram.available|quota:_("MB")|intcomma }}

diff --git a/openstack_dashboard/dashboards/project/networks/workflows.py b/openstack_dashboard/dashboards/project/networks/workflows.py index a1381a4cd..7b84da6fb 100644 --- a/openstack_dashboard/dashboards/project/networks/workflows.py +++ b/openstack_dashboard/dashboards/project/networks/workflows.py @@ -43,7 +43,7 @@ class CreateNetworkInfoAction(workflows.Action): initial=True, required=False) class Meta: - name = ("Network") + name = _("Network") help_text = _("From here you can create a new network.\n" "In addition a subnet associated with the network " "can be created in the next panel.") @@ -88,7 +88,7 @@ class CreateSubnetInfoAction(workflows.Action): initial=False, required=False) class Meta: - name = ("Subnet") + name = _("Subnet") help_text = _('You can create a subnet associated with the new ' 'network, in which case "Network Address" must be ' 'specified. If you wish to create a network WITHOUT a ' @@ -164,7 +164,7 @@ class CreateSubnetDetailAction(workflows.Action): required=False) class Meta: - name = ("Subnet Detail") + name = _("Subnet Detail") help_text = _('You can specify additional attributes for the subnet.') def _convert_ip_address(self, ip, field_name): diff --git a/openstack_dashboard/dashboards/project/routers/panel.py b/openstack_dashboard/dashboards/project/routers/panel.py index 09218dd99..fbaf831ed 100644 --- a/openstack_dashboard/dashboards/project/routers/panel.py +++ b/openstack_dashboard/dashboards/project/routers/panel.py @@ -22,7 +22,7 @@ from openstack_dashboard.dashboards.project import dashboard class Routers(horizon.Panel): - name = "Routers" + name = _("Routers") slug = 'routers' permissions = ('openstack.services.network',) diff --git a/openstack_dashboard/dashboards/project/volumes/templates/volumes/_create.html b/openstack_dashboard/dashboards/project/volumes/templates/volumes/_create.html index 651613a38..fc64394bd 100644 --- a/openstack_dashboard/dashboards/project/volumes/templates/volumes/_create.html +++ b/openstack_dashboard/dashboards/project/volumes/templates/volumes/_create.html @@ -23,8 +23,8 @@

{% trans "Volume Quotas" %}

- {% trans "Total Gigabytes" %} ({{ usages.gigabytes.used|intcomma }} GB) -

{{ usages.gigabytes.available|quota:"GB"|intcomma }}

+ {% trans "Total Gigabytes" %} ({{ usages.gigabytes.used|intcomma }} {% trans "GB" %}) +

{{ usages.gigabytes.available|quota:_("GB")|intcomma }}