Bug 5052 - Can't choose languages if all choices are sublanguages
Summary: Can't choose languages if all choices are sublanguages
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: I18N/L10N (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Bernardo Gonzalez Kriegel
QA Contact: Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-21 19:44 UTC by Owen Leonard
Modified: 2015-06-04 23:30 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 5052 - Can't choose languages if all choices are sublanguage (3.78 KB, patch)
2014-04-04 02:07 UTC, Bernardo Gonzalez Kriegel
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 5052 - Can't choose languages if all choices are sublanguage (3.88 KB, patch)
2014-04-11 18:20 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 5052 - Can't choose languages if all choices are sublanguage (3.92 KB, patch)
2014-04-15 11:30 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Owen Leonard 2010-07-21 19:44:24 UTC
If you have multiple versions of the same language installed:

en
en-GB
en-NZ

...you can have them all enabled via system preferences, but you won't see the language chooser footer menu in the OPAC or staff client unless you have another set of language files installed, whether or not they're enabled.
Comment 1 Owen Leonard 2013-01-09 14:58:58 UTC
Still valid in master.
Comment 2 Bernardo Gonzalez Kriegel 2014-04-04 02:07:59 UTC Comment hidden (obsolete)
Comment 3 Owen Leonard 2014-04-11 18:20:41 UTC Comment hidden (obsolete)
Comment 4 Jonathan Druart 2014-04-15 11:30:57 UTC
Created attachment 27126 [details] [review]
Bug 5052 - Can't choose languages 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!
Comment 5 Galen Charlton 2014-04-15 16:23:49 UTC
Pushed to master.  Thanks, Bernardo!
Comment 6 Fridolin Somers 2014-08-06 09:16:39 UTC
Pushed to 3.14.x, will be in 3.14.10