1 package Koha::Template::Plugin::Languages;
3 # Copyright 2012 ByWater Solutions
4 # Copyright 2013-2014 BibLibre
6 # Koha is free software; you can redistribute it and/or modify it
7 # under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3 of the License, or
9 # (at your option) any later version.
11 # Koha is distributed in the hope that it will be useful, but
12 # WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with Koha; if not, see <http://www.gnu.org/licenses>.
22 use base qw( Template::Plugin );
28 my ( $self, $lang, $code ) = @_;
29 $lang = substr($lang,0,2); #Get db code from Koha lang value
30 my $rfc = C4::Languages::get_rfc4646_from_iso639( $code );
31 my $description = C4::Languages::language_get_description($rfc,$lang,'language');
39 Koha::Template::Plugin::Languages - TT Plugin for languages
45 [% Languages.GetByISOCode( 'LANG', 'ISO639CODE' ) %]
51 In a template, you can get the description for an language value with
52 the following TT code: [% Languages.GetByISOCode( 'LANGUAGE', 'ISO639CODE' ) %]
57 Nick Clemens <nick@bywatersolutions.com>