From: Bill Erickson Date: Mon, 20 Aug 2012 20:26:29 +0000 (-0400) Subject: Improve locale file parsing feedback/log for tpac X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=refs%2Fheads%2Fuser%2Fberick%2Ftpac-locale-log-errors;p=working%2FEvergreen.git Improve locale file parsing feedback/log for tpac Signed-off-by: Bill Erickson --- 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; } }