Several pages have concatenation in the title
Bug #1394573 reported by
Doug Fish
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Dashboard (Horizon) |
Fix Released
|
Undecided
|
Doug Fish |
Bug Description
We have several panels where the add filter is used to concatenate an object to form a page title. This is problem for translation
https:/
There are 16 instances in the code that can be viewed with
grep -r title=_ . | grep add:
description: | updated |
tags: | added: i18n |
Changed in horizon: | |
milestone: | none → kilo-1 |
status: | Fix Committed → Fix Released |
Changed in horizon: | |
milestone: | kilo-1 → 2015.1.0 |
To post a comment you must log in.
I think this is the right pattern for fixing the problem
--- a/openstack_ dashboard/ dashboards/ admin/volumes/ templates/ volumes/ volumes/ detail. html dashboard/ dashboards/ admin/volumes/ templates/ volumes/ volumes/ detail. html
+++ b/openstack_
@@ -3,7 +3,7 @@
{% block title %}{% trans "Volume Details" %}{% endblock %}
{% block page_header %} common/ _page_header. html" with title=_("Volume Details: ")|add: volume. name|default: _("Volume Details:") %} common/ _page_header. html" with title=page_title %}
- {% include "horizon/
+ {% include "horizon/
{% endblock page_header %}
{% block main %} dashboard/ dashboards/ admin/volumes/ volumes/ views.py b/openstack_ dashboard/ dashboards/ admin/volumes/ volumes/ views.py dashboard/ dashboards/ admin/volumes/ volumes/ views.py dashboard/ dashboards/ admin/volumes/ volumes/ views.py dashboard. dashboards. project. volumes. volumes \ volumes_ views.DetailVie w): volumes/ volumes/ detail. html"
diff --git a/openstack_
index be19286..34145ac 100644
--- a/openstack_
+++ b/openstack_
@@ -28,6 +28,12 @@ from openstack_
class DetailView(
template_name = "admin/
+ def get_context_ data(self, **kwargs): context_ data(** kwargs) "page_title" ] = _("Volume Details: %s") % volume.name url(self) : 'horizon: admin:volumes: index')
+ context = super(DetailView, self).get_
+ volume = context["volume"]
+ context[
+ return context
+
def get_redirect_
return reverse(