From bb85ff481d320131b96777e2f9eeb04be4dc5596 Mon Sep 17 00:00:00 2001 From: Robin Sheat Date: Fri, 30 Nov 2012 15:48:50 +1300 Subject: [PATCH] Bug 10560: make it possible for default interface language to not be 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. Signed-off-by: Galen Charlton (cherry picked from commit 38f596d48e19c8f7890caea7a6eb59b6174cf5fa) Signed-off-by: Tomas Cohen Arazi Works as advertised. (cherry picked from commit 8f0ce3c1a0e43e6fb8b7bae56e4d658bfc315631) Signed-off-by: Bernardo Gonzalez Kriegel (cherry picked from commit 8f0ce3c1a0e43e6fb8b7bae56e4d658bfc315631) Signed-off-by: Chris Hall (cherry picked from commit e510a73acf53f76f73168466ee80f5f98d2c8e82) --- C4/Templates.pm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/C4/Templates.pm b/C4/Templates.pm index d6e3ce46e4..ba0684c3b1 100644 --- a/C4/Templates.pm +++ b/C4/Templates.pm @@ -336,6 +336,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'; } -- 2.39.5