Hello all, I need to check and get the current interface language to make some action in Biblio.pm file, i mean like this if ($current_language == "en") { make some action; } else { make another action; } What is the used variable and code to do that? Thanks.
The problem is that you need to have the CGI object in the desired context (language is "calculated" from it). Then use: my $current_language = C4::Languages::getlanguage($query); to set it. 2015-05-28 10:47 GMT-03:00 Abdulsalam Yousef <ayousef@kwareict.com>:
Hello all,
I need to check and get the current interface language to make some action in Biblio.pm file, i mean like this
if ($current_language == "en") {
make some action;
}
else {
make another action;
}
What is the used variable and code to do that?
Thanks. _______________________________________________ Koha mailing list http://koha-community.org Koha@lists.katipo.co.nz https://lists.katipo.co.nz/mailman/listinfo/koha
-- Tomás Cohen Arazi Prosecretaría de Informática Universidad Nacional de Córdoba ✆ +54 351 5353750 ext 13168 GPG: B76C 6E7C 2D80 551A C765 E225 0A27 2EA1 B2F3 C15F
Tomas Cohen Arazi schreef op do 28-05-2015 om 11:01 [-0300]:
The problem is that you need to have the CGI object in the desired context (language is "calculated" from it). Then use:
my $current_language = C4::Languages::getlanguage($query);
if ($current_language == "en")
The other problem is that this isn't correct Perl, it would be: if ($current_language eq "en") -- Robin Sheat Catalyst IT Ltd. ✆ +64 4 803 2204 GPG: 5FA7 4B49 1E4D CAA4 4C38 8505 77F5 B724 F871 3BDF
participants (3)
-
Abdulsalam Yousef -
Robin Sheat -
Tomas Cohen Arazi