Summary: | Choose OPAC language with URL parameter | ||
---|---|---|---|
Product: | Koha | Reporter: | Katrin Fischer <katrin.fischer> |
Component: | I18N/L10N | Assignee: | Frédéric Demians <f.demians> |
Status: | CLOSED FIXED | QA Contact: | Ian Walls <koha.sekjal> |
Severity: | enhancement | ||
Priority: | P5 - low | CC: | jonathan.druart, paul.poulain, semarie |
Version: | 3.6 | ||
Hardware: | All | ||
OS: | All | ||
GIT URL: | Change sponsored?: | --- | |
Patch complexity: | --- | Documentation contact: | |
Documentation submission: | Text to go in the release notes: | ||
Version(s) released in: | Circulation function: | ||
Attachments: |
Proposed patch
Bug 7514 Choose OPAC language with URL parameter [SIGNED-OFF] Bug 7514 Choose OPAC language with URL parameter |
Description
Katrin Fischer
2012-02-09 09:26:36 UTC
Currently, it exists 'changelanguage.pl' which use 'language' parameter for set the language cookie, and redirect to REFERER. See: http://opac/cgi-bin/koha/changelanguage.pl?language=fr-FR Or: koha-git-tree/opac/changelanguage.pl So perhaps just need to use a 'url' parameter for redirect, and if no parameter, fallback to referer... (or if no referer, go to http://opac/) (In reply to comment #1) > Currently, it exists 'changelanguage.pl' which use 'language' parameter for set > the language cookie, and redirect to REFERER. Exactly what I was saying on IRC... patch coming. Created attachment 7523 [details] [review] Proposed patch Wow - that was fast. Thank you Frédéric and Frère Sébastien Marie! Only so I get it right for testing later: Will this change only affect http://opac/cgi-bin/koha/changelanguage.pl?language=fr-FR or should the parameter work for any page after applying the patch? (In reply to comment #4) > Only so I get it right for testing later: Will this change only affect > http://opac/cgi-bin/koha/changelanguage.pl?language=fr-FR or should the > parameter work for any page after applying the patch? The patch of Frederic permit to use the "changelanguage.pl" script directly (without need of referer [setted when called from a link to "changelanguage.pl" for example]) So after called "http://opac/cgi-bin/koha/changelanguage.pl?language=fr-FR" in your browser, the cookie is setted for the rest of the session to fr-FR language. As cookie check is done before browser language detection, the use of this url permit to circumvent the browser default language. Yes. It means that when linking to the OPAC from the outside, the library CMS for example, if you want to bypass language selection via browser language ordered choices, you don't link to: http://myopac but: http://myopac/cgi-bin/koha/changelanguage.pl?language=fr-FR After that, you don't have/can't append 'language' parameter to any OPAC page. Thanks for the explanations - I will test asap. Created attachment 7590 [details] [review] Bug 7514 Choose OPAC language with URL parameter Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> Tested: - with and without cookie set - different language codes http://.../cgi-bin/koha/opac-changelanguage.pl?language=de-DE will directly open the German OPAC. http://.../cgi-bin/koha/opac-changelanguage.pl?language=en will directly open the English OPAC. Created attachment 7591 [details] [review] [SIGNED-OFF] Bug 7514 Choose OPAC language with URL parameter Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> Tested: - with and without cookie set - different language codes http://.../cgi-bin/koha/opac-changelanguage.pl?language=de-DE will directly open the German OPAC. http://.../cgi-bin/koha/opac-changelanguage.pl?language=en will directly open the English OPAC. Marked as Passed QA. Nothing to say, simple patch. Initialize $url variable to '/' if it is not set. This fix was included in the 3.6.x branch prior to 3.6.4. |