Changeset 6926


Ignore:
Timestamp:
2004-03-04T16:38:33+13:00 (20 years ago)
Author:
mdewsnip
Message:

Changed the way display in different languages is done. Instead of passing a language variable throughout the process, the desired resource bundle is explicitly loaded during the initialization of each program (buildcol.pl, classinfo.pl, exportcol.pl, import.pl mkcol.pl, pluginfo.pl).
VS: ----------------------------------------------------------------------

Location:
trunk/gsdl/bin/script
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/bin/script/buildcol.pl

    r6921 r6926  
    234234             'gli', \$gli,
    235235             q^xml^, \$xml)) {
    236     &PrintUsage::print_txt_usage($language, $options, "{buildcol.params}");
     236    &PrintUsage::print_txt_usage($options, "{buildcol.params}");
    237237    die "\n";
    238238    }
    239239
     240    # Load the appropriate resource bundle for the language specified
     241    # If $language is not defined, the default resource bundle will be loaded
     242    &gsprintf::load_resource_bundle($language);
     243
    240244    if ($xml) {
    241         &PrintUsage::print_xml_usage($language, $options);
     245        &PrintUsage::print_xml_usage($options);
    242246    die "\n";
    243247    }
     
    255259    # get and check the collection
    256260    if (($collection = &util::use_collection(@ARGV, $collectdir)) eq "") {
    257     &PrintUsage::print_txt_usage($language, $options, "{buildcol.params}");
     261    &PrintUsage::print_txt_usage($options, "{buildcol.params}");
    258262    die "\n";
    259263    }
  • trunk/gsdl/bin/script/classinfo.pl

    r6921 r6926  
    8888    my $collect = "";
    8989    my $xml = 0;
    90     my $language = "";  # Will display in the default language if not set
    9190
    9291    # Parse command line
     
    9695             q^language/.*/^, \$language))
    9796    {
    98     &PrintUsage::print_txt_usage($language, $options, "{classinfo.params}", 1);
     97    &PrintUsage::print_txt_usage($options, "{classinfo.params}", 1);
    9998    die "\n";
    10099    }
     100
     101    # Load the appropriate resource bundle for the language specified
     102    # If $language is not defined, the default resource bundle will be loaded
     103    &gsprintf::load_resource_bundle($language);
    101104
    102105    # Get classifier
     
    104107    if (!defined $classifier || $classifier eq "") {
    105108    &gsprintf(STDERR, "{classinfo.no_classifier_name}\n\n");
    106     &PrintUsage::print_txt_usage($language, $options, "{classinfo.params}", 1);
     109    &PrintUsage::print_txt_usage($options, "{classinfo.params}", 1);
    107110    die "\n";
    108111    }
     
    119122
    120123    if ($xml) {
    121         $classobj->print_xml_usage($language);
     124        $classobj->print_xml_usage();
    122125    }
    123126    else {
     
    128131    &gsprintf(STDERR, "{classinfo.general_options}\n\n");
    129132
    130     $classobj->print_txt_usage($language);
     133    $classobj->print_txt_usage();
    131134    }
    132135}
  • trunk/gsdl/bin/script/exportcol.pl

    r6921 r6926  
    8484             q^xml^, \$xml)) {
    8585
    86     &PrintUsage::print_txt_usage($language, $options, "{exportcol.params}");
    87     die "\n";
    88     }
     86    &PrintUsage::print_txt_usage($options, "{exportcol.params}");
     87    die "\n";
     88    }
     89
     90    # Load the appropriate resource bundle for the language specified
     91    # If $language is not defined, the default resource bundle will be loaded
     92    &gsprintf::load_resource_bundle($language);
    8993
    9094    if ($xml) {
    91         &PrintUsage::print_xml_usage($language, $options);
     95        &PrintUsage::print_xml_usage($options);
    9296    die "\n";
    9397    }
     
    106110
    107111    if (not @coll_list) { # empty list
    108     &PrintUsage::print_txt_usage($language, $options, "{exportcol.params}");
     112    &PrintUsage::print_txt_usage($options, "{exportcol.params}");
    109113    exit(1);
    110114    }
  • trunk/gsdl/bin/script/import.pl

    r6921 r6926  
    244244             'gli', \$gli,
    245245             q^xml^, \$xml)) {
    246     &PrintUsage::print_txt_usage($language, $options, "{import.params}");
     246    &PrintUsage::print_txt_usage($options, "{import.params}");
    247247    die "\n";
    248248    }
    249249
     250    # Load the appropriate resource bundle for the language specified
     251    # If $language is not defined, the default resource bundle will be loaded
     252    &gsprintf::load_resource_bundle($language);
     253
    250254    if ($xml) {
    251         &PrintUsage::print_xml_usage($language, $options);
     255        &PrintUsage::print_xml_usage($options);
    252256    die "\n";
    253257    }
     
    267271    # get and check the collection name
    268272    if (($collection = &util::use_collection(@ARGV, $collectdir)) eq "") {
    269     &PrintUsage::print_txt_usage($language, $options, "{import.params}");
     273    &PrintUsage::print_txt_usage($options, "{import.params}");
    270274    die "\n";
    271275    }
  • trunk/gsdl/bin/script/mkcol.pl

    r6921 r6926  
    202202              q^xml^, \$xml
    203203              )) {
    204     &PrintUsage::print_txt_usage($language, $options, "{mkcol.params}");
     204    &PrintUsage::print_txt_usage($options, "{mkcol.params}");
    205205    die "\n";
    206206    }
     
    211211    &parse_args (\@ARGV);
    212212
     213    # Load the appropriate resource bundle for the language specified
     214    # If $language is not defined, the default resource bundle will be loaded
     215    &gsprintf::load_resource_bundle($language);
     216
    213217    if ($xml) {
    214     &PrintUsage::print_xml_usage($language, $options);
     218    &PrintUsage::print_xml_usage($options);
    215219    die "\n";
    216220    }
     
    238242    if (!defined($collection)) {
    239243    &gsprintf(STDOUT, "{mkcol.no_colname}\n");
    240     &PrintUsage::print_txt_usage($language, $options, "{mkcol.params}");
     244    &PrintUsage::print_txt_usage($options, "{mkcol.params}");
    241245    die "\n";
    242246    }
  • trunk/gsdl/bin/script/pluginfo.pl

    r6921 r6926  
    7272    my $collect = "";
    7373    my $xml = 0;
    74     my $language = "";  # Will display in the default language if not set
    7574
    7675    if (!parsargv::parse(\@ARGV,
     
    7978             q^language/.*/^, \$language))
    8079    {
    81     &PrintUsage::print_txt_usage($language, $options, "{pluginfo.params}", 1);
     80    &PrintUsage::print_txt_usage($options, "{pluginfo.params}", 1);
    8281    die "\n";
    8382    }
     83
     84    # Load the appropriate resource bundle for the language specified
     85    # If $language is not defined, the default resource bundle will be loaded
     86    &gsprintf::load_resource_bundle($language);
    8487
    8588    my $plugin = shift (@ARGV);
    8689    if (!defined $plugin || $plugin eq "") {
    8790    &gsprintf(STDERR, "{pluginfo.no_plugin_name}\n\n");
    88     &PrintUsage::print_txt_usage($language, $options, "{pluginfo.params}", 1);
     91    &PrintUsage::print_txt_usage($options, "{pluginfo.params}", 1);
    8992    die "\n";
    9093    }
     
    100103
    101104    if ($xml) {
    102         $plugobj->print_xml_usage($language);
     105        $plugobj->print_xml_usage();
    103106    }
    104107    else {
     
    109112    &gsprintf(STDERR, "{pluginfo.general_options}\n\n");
    110113
    111     $plugobj->print_txt_usage($language);
     114    $plugobj->print_txt_usage();
    112115    }
    113116}
Note: See TracChangeset for help on using the changeset viewer.