PEF::Front::NLS - Localization support
my $comments_number_text = msg_get_n( $context->{lang}, '$1 comments', $comment_count, $comment_count )->{message};
Sometimes application has to return localized messages.
Returns localized text for message $msgid and language $lang. It supports parameterized messages like:
$msgid
$lang
my $message = msg_get($context->{lang}, 'Hello $1', $user->{name});.
This works like Cmsg_get> but supports singular/plural forms. $num is used to select right form.
$num
Checks whether there's localized text for given $lang, $msgid in database.
$lang, $msgid
Returns short (ISO 639-1) language code. This function automatically detect language based on URL, HTTP headers, cookies and Geo IP. You can turn it off setting cfg_no_multilang_support to true. When it can't detect language or language detection is off then it returns cfg_default_lang.
cfg_no_multilang_support
cfg_default_lang
This module was written and is maintained by Anton Petrusevich.
Copyright (c) 2016 Anton Petrusevich. Some Rights Reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install PEF::Front, copy and paste the appropriate command in to your terminal.
cpanm
cpanm PEF::Front
CPAN shell
perl -MCPAN -e shell install PEF::Front
For more information on module installation, please visit the detailed CPAN module installation guide.