From 36c1d9af5368ffba84061949343db802c24a1e66 Mon Sep 17 00:00:00 2001 From: Robin Sheat Date: Fri, 30 Nov 2012 15:48:50 +1300 Subject: [PATCH] [PASSED QA] Bug 10560 - No way to disable english If you enable another translation, and disable english, then if you dont have a cookie set, or your browser is not set to that language, you will get english. So you can not disable english in either the staff client or the OPAC. This patch fixes the language selection to do the right thing. To test you must have at least one other language installed besides English. Apply the patch and disable the en translation. Koha should fall back to one of the enabled translations. Signed-off-by: Owen Leonard I added a patch description and test plan, missing from the original patch. Signed-off-by: Katrin Fischer I have tested with various combinations of activated languages and have found no regression. If the cookie is set, the right language is shown accordingly. Else the first language in the list seems to be picked. It did never fall back to English in my tests, when English was explicitly deactivated. Passes all tests and QA script. --- C4/Templates.pm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/C4/Templates.pm b/C4/Templates.pm index 88b9b01..21604fc 100644 --- a/C4/Templates.pm +++ b/C4/Templates.pm @@ -344,6 +344,10 @@ sub getlanguage { return $lang; } + # Pick the first selected syspref language + $lang = shift @languages; + return $lang if $lang; + # Fall back to English if necessary return 'en'; } -- 1.7.9.5