Re-enable dashboard internationalization/localization

Registered by Jeffrey Wilcox

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

Status:
Complete
Approver:
Devin Carlen
Priority:
High
Drafter:
None
Direction:
Approved
Assignee:
Jeffrey Wilcox
Definition:
Approved
Series goal:
Accepted for essex
Implementation:
Implemented
Milestone target:
milestone icon 2012.1
Started by
Jeffrey Wilcox
Completed by
Devin Carlen

Related branches

Sprints

Whiteboard

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.

2011-09-25

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.

Jeff

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

Devin

----------------------------------------------------------

_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.

Subscribers

No subscribers.