Koha/koha-tmpl/intranet-tmpl/prog/en/includes/intranet-bottom.inc
Bernardo Gonzalez Kriegel c212b9328e Bug 5052: make it possible to pick a language if all choices are sublanguage
This was tricky to catch. In current implementation, Bug 6755
introduced in C4/Templates.pm as condition to send the array of
hashrefs of languages that (@$languages_loop<2), but with one
language group that condition is false, there is only one
element in that array.

This patch changes that condition to have more than one language
selected, grouped or not.

Also send $bidi value always, that was only sent if there is
more than one group language.

To test:
1. Translate to en-GB and en-NZ, or simply do mkdirs
on intranet-tmpl/prog and opac-tmpl/bootstrap

2. Go to Administration > System preferences > I18N
enable those languages on staff/opac

3. Check that language chooser is nowhere to be found

4. Apply the patch

5. Reload staff/opac, now you can see language chooser

NOTE: I made little changes on staff, but can't replicate
bootstrap colors for selected/unselected language. Someone
need to touch css files to make it happen. But that is
current behavior.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Good catch!

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-04-15 14:36:29 +00:00

56 lines
2.7 KiB
HTML

</div>
[% IF ( languages_loop ) %]
[% UNLESS ( one_language_enabled ) %]
<div id="changelanguage" class="navbar navbar-fixed-bottom">
<div class="navbar-inner">
<ul id="i18nMenu" class="nav">
[% FOREACH languages_loo IN languages_loop %]
[% IF ( languages_loo.group_enabled ) %]
[% IF ( languages_loo.plural ) %]
<li class="dropdown"><a class="dropdown-toggle dropup" data-toggle="dropdown" id="show[% languages_loo.rfc4646_subtag %]" href="#">[% IF ( languages_loo.native_description ) %][% languages_loo.native_description %][% ELSE %][% languages_loo.rfc4646_subtag %][% END %] <span class="caret"></span></a>
<ul id="sub[% languages_loo.rfc4646_subtag %]" class="dropdown-menu">
[% FOREACH sublanguages_loo IN languages_loo.sublanguages_loop %]
[% IF ( sublanguages_loo.enabled ) %]
[% IF ( sublanguages_loo.sublanguage_current ) %]
<li> <a href="#">[% sublanguages_loo.native_description %] [% sublanguages_loo.script_description %] [% sublanguages_loo.region_description %] [% sublanguages_loo.variant_description %] ([% sublanguages_loo.rfc4646_subtag %])</a></li>
[% ELSE %]
<li><a href="/cgi-bin/koha/changelanguage.pl?language=[% sublanguages_loo.rfc4646_subtag %]"> [% sublanguages_loo.native_description %] [% sublanguages_loo.script_description %] [% sublanguages_loo.region_description %] [% sublanguages_loo.variant_description %] ([% sublanguages_loo.rfc4646_subtag %])</a></li>
[% END %]
[% END %]
[% END %]
</ul></li>
[% ELSE %]
[% IF ( languages_loo.group_enabled ) %]
[% IF ( languages_loo.current ) %]
<li class="navbar-text">
[% IF ( languages_loo.native_description ) %]
[% languages_loo.native_description %]
[% ELSE %]
[% languages_loo.rfc4646_subtag %]
[% END %]
</li>
[% ELSE %]
<li><a href="/cgi-bin/koha/changelanguage.pl?language=[% languages_loo.rfc4646_subtag %]">
[% IF ( languages_loo.native_description ) %]
[% languages_loo.native_description %]
[% ELSE %]
[% languages_loo.rfc4646_subtag %]
[% END %]
</a></li>
[% END %]
[% END %]
[% END %]
[% END %]
[% END %]
</ul>
</div>
</div>
[% END %]
[% END %]
</body>
</html>