Skip to content

Commit

Permalink
impalacized dictionaries and language packs page (bug 684300)
Browse files Browse the repository at this point in the history
  • Loading branch information
potch committed Sep 6, 2011
1 parent 1a3059a commit 800348d
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 29 deletions.
77 changes: 48 additions & 29 deletions apps/browse/templates/browse/language_tools.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{% extends "base.html" %}
{% extends "impala/base.html" %}

{% block title %}{{ _('Dictionaries & Language Packs') }}{% endblock %}
{% block bodyclass %}dictionaries{% endblock %}

{% if request.APP.browser %}
{% set install_dict = _('Install Dictionary') %}
Expand All @@ -25,34 +26,52 @@
{% block content %}
{% cache addons %}
<header>
{{ breadcrumbs([(None, _('Dictionaries & Language Packs'))]) }}
<h2>{{ _('Dictionaries & Language Packs') }}</h2>
{{ impala_breadcrumbs([(None, _('Dictionaries & Language Packs'))]) }}
<h1>{{ _('Dictionaries & Language Packs') }}</h1>
</header>
<div class="featured">
<div class="featured-inner">
<div id="dictionaries">
<table>
<caption>{{ _('List of language packs and dictionaries.') }}</caption>
<thead>
<tr>
<th colspan="2">{{ _('Language') }}</th>
<th>{{ _('Dictionary') }}</th>
<th>{{ _('Language Pack') }}</th>
</tr>
</thead>
<tbody>
{% for lang, locale in locales %}
<tr>
<th>{{ locale.display }}</th>
<td lang="{{ lang }}">{{ locale.native }}</td>
<td>{{ langtool(locale.dicts, install_dict) }}</td>
<td>{{ langtool(locale.packs, install_pack) }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
<section class="island">
<h2>{{ _('Available in your locale') }}</h2>
<table>
<caption>{{ _('List of language packs and dictionaries available in your locale.') }}</caption>
<thead>
<tr>
<th colspan="2">{{ _('Language') }}</th>
<th>{{ _('Dictionary') }}</th>
<th>{{ _('Language Pack') }}</th>
</tr>
</thead>
<tbody>
{% for lang, locale in lang_addons %}
<tr>
<th>{{ locale.display }}</th>
<td lang="{{ lang }}">{{ locale.native }}</td>
<td>{{ langtool(locale.dicts, install_dict) }}</td>
<td>{{ langtool(locale.packs, install_pack) }}</td>
</tr>
{% endfor %}
</tbody>
</table>
<h2>{{ _('All locales') }}</h2>
<table>
<caption>{{ _('List of language packs and dictionaries.') }}</caption>
<thead>
<tr>
<th colspan="2">{{ _('Language') }}</th>
<th>{{ _('Dictionary') }}</th>
<th>{{ _('Language Pack') }}</th>
</tr>
</thead>
<tbody>
{% for lang, locale in locales %}
<tr>
<th>{{ locale.display }}</th>
<td lang="{{ lang }}">{{ locale.native }}</td>
<td>{{ langtool(locale.dicts, install_dict) }}</td>
<td>{{ langtool(locale.packs, install_pack) }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</section>
{% endcache %}
{% endblock %}
2 changes: 2 additions & 0 deletions apps/browse/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,10 @@ def language_tools(request, category=None):
.filter(appsupport__app=request.APP.id, type__in=types,
target_locale__isnull=False).exclude(target_locale=''))
locales = _get_locales(addons)
lang_addons = _get_locales(addons.filter(target_locale=request.LANG))
return jingo.render(request, 'browse/language_tools.html',
{'locales': locales, 'addons': addons,
'lang_addons': lang_addons,
'search_cat': '%s,0' % amo.ADDON_DICT})


Expand Down
1 change: 1 addition & 0 deletions settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,7 @@ def JINJA_CONFIG():
'css/impala/colorpicker.less',
'css/impala/personas.less',
'css/impala/login.less',
'css/impala/dictionaries.less',
),
'zamboni/discovery-pane': (
'css/zamboni/discovery-pane.css',
Expand Down

0 comments on commit 800348d

Please sign in to comment.