Bug 5052: make it possible to pick a language if all choices are sublanguage
authorBernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Fri, 4 Apr 2014 01:37:09 +0000 (22:37 -0300)
committerGalen Charlton <gmc@esilibrary.com>
Tue, 15 Apr 2014 14:36:29 +0000 (14:36 +0000)
commitc212b9328edd69a8e8f5082674a9f29741d159ee
tree4b6b4280f28a1d445a502c8300c52c35f63807ef
parent95056d17b715b74e3f7149d60e12d5a365d70eeb
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>
C4/Templates.pm
koha-tmpl/intranet-tmpl/prog/en/includes/intranet-bottom.inc