Using Lingua::EN::Titlecase, perform a "Title Case" case transform on the 245$a
value as displayed in TPAC.
TODO: Make this configurable, allow it to fail gracefully when
Lingua::EN::Titlecase is not present.
Signed-off-by: Jeff Godin <jgodin@tadl.org>
Conflicts:
Open-ILS/src/templates/opac/parts/misc_util.tt2
use XML::LibXML;
use File::stat;
use Encode;
+use Lingua::EN::Titlecase;
use Apache2::Const -compile => qw(OK DECLINED HTTP_INTERNAL_SERVER_ERROR);
use Apache2::Log;
use OpenSRF::EX qw(:try);
$ctx->{encode_utf8} = sub {return encode_utf8(shift())};
- unless($tt->process($template, {ctx => $ctx, ENV => \%ENV, l => $text_handler})) {
+ unless($tt->process($template, {ctx => $ctx, ENV => \%ENV, l => $text_handler, tc => Lingua::EN::Titlecase->new()})) {
$r->log->warn('egweb: template error: ' . $tt->error);
return Apache2::Const::HTTP_INTERNAL_SERVER_ERROR;
}