Changeset 10982 for trunk/gsdl


Ignore:
Timestamp:
2005-12-09T11:16:56+13:00 (18 years ago)
Author:
jrm21
Message:

better handle a missing strings.rb bundle file, and print a warning to
STDERR.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/perllib/gsprintf.pm

    r10228 r10982  
    156156
    157157    %defaultresourcebundle = &read_resource_bundle($resourcebundlefile);
    158     return if (!%defaultresourcebundle);
     158    if (!%defaultresourcebundle) {
     159        # $! will still have the error value for the last failed syscall
     160        print STDERR "$! $resourcebundlefile\n";
     161    # set something so we don't bother trying to load it again
     162    $defaultresourcebundle{0}=undef;
     163        return;
     164    }
    159165
    160166    # Read the output encoding to use from the resource bundle
     
    175181    $englishoutputencoding = $specialoutputencoding;
    176182    }
    177     if ($defaultresourcebundle{"{Language.code}"} eq "en") {
     183   
     184    if ($defaultresourcebundle{"{Language.code}"} &&
     185        $defaultresourcebundle{"{Language.code}"} eq "en") {
    178186    %englishresourcebundle = %defaultresourcebundle;
    179187    $englishoutputencoding = $defaultoutputencoding;
Note: See TracChangeset for help on using the changeset viewer.