From dec16c57fff83c940c218e977f92c6e4e571ba6e Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Mon, 20 Aug 2012 16:26:29 -0400 Subject: [PATCH] Improve locale file parsing feedback/log for tpac Signed-off-by: Bill Erickson --- Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm index 44c6018042..3ba41112e0 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm @@ -149,7 +149,7 @@ sub load_context { $ctx->{template_paths} = [ reverse @template_paths ]; my %locales = $r->dir_config->get('OILSWebLocale'); - load_locale_handlers($ctx, %locales); + load_locale_handlers($r, $ctx, %locales); $ctx->{locales} = \%registered_locales; @@ -260,6 +260,7 @@ sub find_template { # Create an I18N sub-module for each supported locale # Each module creates its own MakeText lexicon by parsing .po/.mo files sub load_locale_handlers { + my $r = shift; my $ctx = shift; my %locales = @_; @@ -319,8 +320,9 @@ sub load_locale_handlers { eval $eval; if ($@) { - warn "$@\n" if $@; + $r->log->error("egweb: error loading .po file for $tag / $locale_name: $@"); } else { + $r->log->debug("egweb: successfully loaded .po file for $tag / $locale_name"); $registered_locales{"$tag"} = $locale_name; } } -- 2.11.0