C4::Languages - Perl Module containing language list functions for Koha
use C4::Languages;
Returns a reference to an array of hashes:
my $languages = getFrameworkLanguages(); for my $language(@$languages) { print "$language->{language_code}\n"; # language code in iso 639-2 print "$language->{language_name}\n"; # language name in native script print "$language->{language_locale_name}\n"; # language name in current locale }
Returns a reference to an array of hashes:
my $languages = getTranslatedLanguages(); print "Available translated languages:\n"; for my $language(@$trlanguages) { print "$language->{language_code}\n"; # language code in iso 639-2 print "$language->{language_name}\n"; # language name in native script print "$language->{language_locale_name}\n"; # language name in current locale }
Returns a reference to an array of hashes:
my $alllanguages = getAllLanguages(); print "Available translated languages:\n"; for my $language(@$alllanguages) { print "$language->{language_code}\n"; print "$language->{language_name}\n"; print "$language->{language_locale_name}\n"; }
This routine is a wrapper for getLanguages().
my $lang_arrayref = getLanguages([$lang[, $isFiltered]]);
Returns a reference to an array of hashes of languages.
- If no parameter is passed to the function, it returns english languages names - If a $lang parameter conforming to RFC4646 syntax is passed, the function returns languages names translated in $lang If a language name is not translated in $lang in database, the function returns english language name - If $isFiltered is set to true, only the detail of the languages selected in system preferences AdvanceSearchLanguages is returned.
Internal function, returns an array of all available themes.
(@themes) = &_get_themes('opac'); (@themes) = &_get_themes('intranet');
Internal function, returns an array of directory names, excluding non-language directories
Internal function for building the ref to array of hashes
FIXME: this could be rewritten and simplified using map
This internal sub takes a string composed according to RFC 4646 as an input and returns a reference to a hash containing keys and values for ( language, script, region, variant, extension, privateuse )
Select a language based on the URL parameter 'language', a cookie, syspref available languages & browser
Joshua Ferraro