Re-enable dashboard internationalization/localization

Registered by Jeffrey Wilcox on 2011-09-07

The localization has fallen behind changes in the dashboard, and there are two issues that I came across that I'd like to discuss before preparing a pull request: (1) compatibility with the _page_header.html partial template call and (2) where to put the language selector in the UI.

Blueprint information

Devin Carlen
Jeffrey Wilcox
Series goal:
Accepted for essex
Milestone target:
milestone icon 2012.1
Started by
Jeffrey Wilcox on 2011-09-07
Completed by
Devin Carlen on 2011-10-25

Related branches



2011-10-25 (Devin) I am marking this as implemented since all of the changes you discussed are implemented now I believe. Let me know if there is anything we missed here and we'll open separate bugs for those.


Sorry about that, I've been heads-down with a release.

I've confirmed that the {...with title=_("Launch Instance")} technique works though the {% trans "Launch Instance" as title %} technique does not. I should have a patch ready later this week.


2011-09-24 - Jeff, any update on this?



_page_header.html issue:

If I localize the page title within the partial, only the 'title' variable name shows up in the localization files, not all the titles for the various pages. I wasn't able to get it working when I translated the title in each page and then passed the translated title to the partial because the with clause and i18n fought.

(Devin) I see what you're saying. Have you tried something like this?

Instead of:

{% block page_header %}
  {# to make searchable false, just remove it from the include statement #}
  {% include "_page_header.html" with title="Launch Instance" %}
{% endblock page_header %}

Django supports the _() string localization method within templates. I believe you can do something like:

  {% include "_page_header.html" with title=_("Launch Instance") %}

Or perhaps something crazier like:

{% block page_header %}
  {# to make searchable false, just remove it from the include statement #}
  {% trans "Launch Instance" as title %}
  {% include "_page_header.html" with title="title}}" %}
{% endblock page_header %}

I've gotten it working two ways: either in-line the _page_header back into all the pages, or set the page title in the view as a variable instead of in the template. I'm not really happy with either solution, since I'm either duplicating a lot of code, or pulling the page titles out of the templates where they belong.

Better Ideas? Preferences? Am I missing something?

UI Issue:

I managed an *ok* looking language selector button in the page header, but I don't really like it. I'm thinking that I should code a settings page (like the ubiquitous gear button on Google sites), and combine the language settings there with any other dashboard configuration.

(Devin) In Essex time frame, we are going to be doing a major rework of the user interaction flows and overall site design. So my advice is just go ahead and make something reasonable work and we'll be incorporate your features with our new design as well.

If people like this idea, what else should I put on the dashboard settings page?


Work Items

This blueprint contains Public information 
Everyone can see this information.


No subscribers.