NAME
CallBackery::Translate - gettext po file translation functionality
SYNOPSIS
use CallBackery::Translate qw(mtr);
my $loc = CallBackery::Translate->new(localeRoot=>$dir);
$loc->setLocale('de');
$loc->tra("Hello %1","Tobi");
trm("Mark but for translation but return original");
DESCRIPTION
Read translations from gettext po files and translate incoming data.
setLocale
($locale);-
Load the translations strings for $locale. First try the full name and then top-up with only the language part.
tra
(str[,arg,arg,...])-
Translate string into the curent language.
trm
(str[,arg,arg,...])-
mark for translation but return an array pointer so that the string can be translated dynamically in the frontend. This functionality is not yet fully implemented.
trm($str[,@args]);
Make string and prepare for translation in the frontend.
Note there is some major perl magic going on! by blessing the returned array into the current package, we then get to use the overload code on stringification AND Mojo::JSON gets to use the TO_JSON method when converting this into something to be transported to the frontend.
$str->TO_JSON
Help Mojo::JSON encode us into JSON.
COPYRIGHT
Copyright (c) 2010 by OETIKER+PARTNER AG. All rights reserved.
AUTHOR
Tobias Oetiker <tobi@oetiker.ch>
HISTORY
2010-12-22 to 1.0 first version
2 POD Errors
The following errors were encountered while parsing the POD:
- Around line 111:
You forgot a '=back' before '=head2'
- Around line 159:
=back without =over