From ea695f54e7267b1c25f1bd3507aaabd88f695ee7 Mon Sep 17 00:00:00 2001 From: Jeff Godin Date: Wed, 25 Jul 2012 09:35:07 -0400 Subject: [PATCH] Display 245$a as Title Case in TPAC 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 Conflicts: Open-ILS/src/templates/opac/parts/misc_util.tt2 --- Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm index d111cd2ac9..dc80789dae 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm @@ -5,6 +5,7 @@ use XML::Simple; 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); @@ -73,7 +74,7 @@ sub handler_guts { $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; } -- 2.11.0