|
Lines 1-5
Link Here
|
| 1 |
package Koha::Language; |
1 |
package Koha::Language; |
| 2 |
|
2 |
|
|
|
3 |
# Copyright 2025 Koha development team |
| 4 |
# |
| 5 |
# This file is part of Koha. |
| 6 |
# |
| 7 |
# Koha is free software; you can redistribute it and/or modify it |
| 8 |
# under the terms of the GNU General Public License as published by |
| 9 |
# the Free Software Foundation; either version 3 of the License, or |
| 10 |
# (at your option) any later version. |
| 11 |
# |
| 12 |
# Koha is distributed in the hope that it will be useful, but |
| 13 |
# WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 |
# GNU General Public License for more details. |
| 16 |
# |
| 17 |
# You should have received a copy of the GNU General Public License |
| 18 |
# along with Koha; if not, see <http://www.gnu.org/licenses>. |
| 19 |
|
| 3 |
=head1 NAME |
20 |
=head1 NAME |
| 4 |
|
21 |
|
| 5 |
Koha::Language |
22 |
Koha::Language |
|
Lines 27-32
use Koha::Cache::Memory::Lite;
Link Here
|
| 27 |
|
44 |
|
| 28 |
use constant REQUESTED_LANGUAGE_CACHE_KEY => 'requested_language'; |
45 |
use constant REQUESTED_LANGUAGE_CACHE_KEY => 'requested_language'; |
| 29 |
|
46 |
|
|
|
47 |
=head1 METHODS |
| 48 |
|
| 49 |
=head2 set_requested_language |
| 50 |
|
| 51 |
Caches requested language |
| 52 |
|
| 53 |
=cut |
| 54 |
|
| 30 |
sub set_requested_language { |
55 |
sub set_requested_language { |
| 31 |
my ($class, $language) = @_; |
56 |
my ($class, $language) = @_; |
| 32 |
|
57 |
|
|
Lines 35-40
sub set_requested_language {
Link Here
|
| 35 |
$cache->set_in_cache(REQUESTED_LANGUAGE_CACHE_KEY, $language); |
60 |
$cache->set_in_cache(REQUESTED_LANGUAGE_CACHE_KEY, $language); |
| 36 |
} |
61 |
} |
| 37 |
|
62 |
|
|
|
63 |
=head2 get_requested_language |
| 64 |
|
| 65 |
Gets requested language from cache |
| 66 |
|
| 67 |
=cut |
| 68 |
|
| 38 |
sub get_requested_language { |
69 |
sub get_requested_language { |
| 39 |
my ($class) = @_; |
70 |
my ($class) = @_; |
| 40 |
|
71 |
|
| 41 |
- |
|
|