mirror of
https://github.com/Hopiu/django-rosetta.git
synced 2026-05-12 15:23:10 +00:00
Fixed reflang switching – keeping current reflang selected.
This commit is contained in:
parent
0aa1b1917f
commit
90cf37c912
2 changed files with 8 additions and 6 deletions
|
|
@ -40,11 +40,11 @@
|
|||
</ul>
|
||||
|
||||
{% if ENABLE_REFLANG %}
|
||||
REF : <select onchange="javascript:window.location.href = this.value;">
|
||||
{% for langid, langname in LANGUAGES %}
|
||||
<option{% ifequal ref_lang langid %} selected="selected"{% endifequal %} value="{% url 'rosetta-reference-selection' langid=langid %}">{{langname}}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
REF : <select onchange="javascript:window.location.href = this.value;">
|
||||
{% for langid, langname in LANGUAGES %}
|
||||
<option{% ifequal ref_lang langid %} selected="selected"{% endifequal %} value="{% url 'rosetta-reference-selection' langid=langid %}">{{langname}}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
{% endif %}
|
||||
|
||||
<div id="changelist" class="module{% if rosetta_i18n_lang_bidi %} rtl{% endif %}">
|
||||
|
|
|
|||
|
|
@ -219,6 +219,7 @@ def home(request):
|
|||
o.ref_txt = ref_entry.msgstr
|
||||
LANGUAGES = list(settings.LANGUAGES) + [('msgid', 'MSGID')]
|
||||
else:
|
||||
ref_lang = None
|
||||
LANGUAGES = settings.LANGUAGES
|
||||
|
||||
if 'page' in request.GET and int(request.GET.get('page')) <= paginator.num_pages and int(request.GET.get('page')) > 0:
|
||||
|
|
@ -287,7 +288,8 @@ def home(request):
|
|||
page=page,
|
||||
query=query,
|
||||
paginator=paginator,
|
||||
rosetta_i18n_pofile=rosetta_i18n_pofile
|
||||
rosetta_i18n_pofile=rosetta_i18n_pofile,
|
||||
ref_lang=ref_lang,
|
||||
), context_instance=RequestContext(request))
|
||||
else:
|
||||
return list_languages(request, do_session_warn=True)
|
||||
|
|
|
|||
Loading…
Reference in a new issue