Passed variables in template not translated

Bug #1180316 reported by Tihomir Trifonov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Low
Julie Pichon
Grizzly
Fix Released
Low
Akihiro Motoki

Bug Description

Some variables are passed in templates as:

    <h2>{{ title }}</h2>

To be translated on render, this needs to be:

    <h2>{% trans title %}</h2>

so that ugettext() to be called using the chosen language.

Julie Pichon (jpichon)
Changed in horizon:
assignee: nobody → Julie Pichon (jpichon)
Revision history for this message
Julie Pichon (jpichon) wrote :

Although there are places e.g. for workflows where only {{ title }} is displayed on the template, the lazy translation mechanism appears to work just fine so I don't think they need to be modified.

I'm using this bug as an opportunity to fix up a few more variables that weren't marked as translatable.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (master)

Fix proposed to branch: master
Review: https://review.openstack.org/29762

Changed in horizon:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/29762
Committed: http://github.com/openstack/horizon/commit/acfb83d5d5e45506cb2198869bc9e345f87ff6ea
Submitter: Jenkins
Branch: master

commit acfb83d5d5e45506cb2198869bc9e345f87ff6ea
Author: Julie Pichon <email address hidden>
Date: Fri May 17 16:38:25 2013 +0100

    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

Changed in horizon:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in horizon:
milestone: none → havana-1
status: Fix Committed → Fix Released
Revision history for this message
Akihiro Motoki (amotoki) wrote :

I believe the commit above in master branch is worth backport to Grizzly.

The point everyone notices is that "Routers" panel name is not translatable.
If a language other than English is used, only "Routers" panel is shown in English.
This looks very strange.

Note that I think introducing blocktrans should not be backported
since it changes the original strings and translations have no corresponding texts.
Other changes are worth backport.

tags: added: grizzly-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (stable/grizzly)

Fix proposed to branch: stable/grizzly
Review: https://review.openstack.org/32667

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (stable/grizzly)

Reviewed: https://review.openstack.org/32667
Committed: http://github.com/openstack/horizon/commit/598c73567e1b162ba6ed0d3990530f10c90bfdba
Submitter: Jenkins
Branch: stable/grizzly

commit 598c73567e1b162ba6ed0d3990530f10c90bfdba
Author: Akihiro MOTOKI <email address hidden>
Date: Tue Jun 11 16:41:40 2013 +0900

    Mark additional strings as translatable

    Some variables and templates variables that should be translatable
    weren't marked as such.

    Fixes bug #1180316

    Note the change in horizon/templates/horizon/common/_quota_summary.html
    is not backported in this commit to keep the existing translations work.

    Change-Id: I90baf19c4bea09c126f8ed225777037194f5331f
    (cherry picked from commit acfb83d5d5e45506cb2198869bc9e345f87ff6ea)

tags: added: in-stable-grizzly
Alan Pevec (apevec)
Changed in horizon:
importance: Undecided → Low
tags: removed: grizzly-backport-potential in-stable-grizzly
Thierry Carrez (ttx)
Changed in horizon:
milestone: havana-1 → 2013.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.