| Summary: | Preserve language choice between Browser sessions | ||
|---|---|---|---|
| Product: | Koha | Reporter: | Marc Véron <veron> |
| Component: | I18N/L10N | Assignee: | Marc Véron <veron> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P2 | CC: | chris, julian.maurice, marc, paul.poulain, veron |
| Version: | 3.10 | ||
| Hardware: | All | ||
| OS: | All | ||
| GIT URL: | Initiative type: | --- | |
| Sponsorship status: | --- | Comma delimited list of Sponsors: | |
| Crowdfunding goal: | 0 | Patch complexity: | --- |
| Documentation contact: | Documentation submission: | ||
| Text to go in the release notes: | Version(s) released in: | ||
| Circulation function: | |||
| Attachments: |
Bug 8019 - Preserve language choice between Browser sessions
[SIGNED-OFF] Preserve language choice between Browser sessions |
||
Created attachment 9333 [details] [review] Bug 8019 - Preserve language choice between Browser sessions Language choice in Opac an Staff client was not preserved between Browser sessions. Changed expiry date of cookie 'KohaOpacLanguage' from '' (= expire after session) to '+3y' (3 years from now) To test: - In a multilingual Koha istallation, choose a language. - Log out, close all Browser instances. Go to login screen. Login should show up in same language as before. - Repeat with other languages. modified: C4/Templates.pm Created attachment 9401 [details] [review] [SIGNED-OFF] Preserve language choice between Browser sessions Works as expected, signed off QA comment: tiny path, passes QA I just lowered the severity, it's not major, the user has 1 click to do to switch back to his preffered language |
If I select a language in Staff client or Opac, I expect it to be persistent between browser sessions. This is not the case. Koha forgets the selection as soon as all Broser instances are closed, and starts up the next session with the Browser's preferred language. This behaviour is due to the Cookie KohaOpacLanguage. I expires when the browser is closed because no expiry date is set in C4\Templates.pm, line 298 ff: sub setlanguagecookie { my ( $query, $language, $uri ) = @_; my $cookie = $query->cookie( -name => 'KohaOpacLanguage', -value => $language, -expires => '' ); print $query->redirect( -uri => $uri, -cookie => $cookie ); } Solution: Set -expires to a value like +3y (3 years from now)