Ignore:
Timestamp:
2003-07-03T15:59:04+12:00 (21 years ago)
Author:
mdewsnip
Message:

Further work on standardising option descriptions. Specifically, in preparation for translating the option descriptions into other languages, all the option description strings have been moved in a "resource bundle" file (modelled on a Java resource bundle). (This also has the advantage of reducing the number of duplicate descriptions). The option descriptions in the plugins, classifiers, mkcol.pl, import.pl and buildcol.pl have been replaced with keys into this resource bundle (perllib/strings.rb). When translating the strings in this file into a new language, the new resource bundle should be named strings_<language-code>.rb (where <language-code> is a combination of language and country, eg. 'fr_FR' for the version of French spoken in France).

To support these changes, the PrintUsage module (perllib/printusage.pm) has new code for reading resource bundles and displaying the correct strings. Also, pluginfo.pl, classinfo.pl, mkcol.pl, import.pl and buildcol.pl have a new option (-language) for specifying the language code to display option descriptions in.

If a resource bundle for the specified language code does not exist, a generic resource bundle is used (strings.rb). This currently contains the English text descriptions. However, for users who always use Greenstone in another language, it would be easier to rename the standard file to strings_en_US.rb and rename the resource bundle of their desired language to strings.rb. This would mean they would not have to constantly specify their language with the -language option, since the default resource bundle will suit them.

Currently, the encoding names (in encodings.pm) are not part of this scheme. These are displayed as part of BasPlug's input_encoding option. It is debatable whether these names would be worth translating into other languages.

Parse errors in plugins and classifiers currently cause them to display the usage information using the default resource bundle. It is likely that BasPlug will soon have an option added to specify the language for the usage information in this case. (Note that this does not include using pluginfo.pl or classinfo.pl to display usage information - these have a -language option).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/perllib/plugins/PSPlug.pm

    r4785 r4873  
    3737my $arguments =
    3838    [ { 'name' => "process_exp",
    39     'desc' => "A perl regular expression to match against filenames. Matching filenames will be processed by this plugin. For example, using '(?i).html?\$' matches all documents ending in .htm or .html (case-insensitive).",
     39    'desc' => "{BasPlug.process_exp}",
    4040    'type' => "string",
    4141    'deft' => &get_default_process_exp(),
    4242    'reqd' => "no" },
    4343      { 'name' => "block_exp",
    44     'desc' => "Files matching this regular expression will be blocked from being passed to any later plugins in the list. This has no real effect other than to prevent lots of warning messages about input files you don't care about. Each plugin might have a default block_exp. e.g. by default HTMLPlug blocks any files with .gif, .jpg, .jpeg, .png or .css file extensions.",
     44    'desc' => "{BasPlug.block_exp}",
    4545    'type' => 'string',
    4646    'deft' => &get_default_block_exp() },
    4747      { 'name' => "extract_date",
    48     'desc' => "Extract date from PS header.",
     48    'desc' => "{PSPlug.extract_date}",
    4949    'type' => "flag" },
    5050      { 'name' => "extract_pages",
    51     'desc' => "Extract pages from PS header.",
     51    'desc' => "{PSPlug.extract_pages}",
    5252    'type' => "flag" },
    5353      { 'name' => "extract_title",
    54     'desc' => "Extract title from PS header.",
     54    'desc' => "{PSPlug.extract_title}",
    5555    'type' => "flag" } ];
    5656
    5757my $options = { 'name'     => "PSPlug",
    58         'desc'     => "This might look VERY similar to the PDF plugin.",
     58        'desc'     => "This is a \"poor man's\" ps to text converter. If you are serious, consider using the PRESCRIPT package, which is available for download at http://www.nzdl.org/html/software.html",
    5959        'inherits' => "yes",
    6060        'args'     => $arguments };
     
    7777             "allow_extra_options")) {
    7878    print STDERR "\nIncorrect options passed to HTMLPlug, check your collect.cfg configuration file\n";
    79     $self->print_txt_usage();
     79    $self->print_txt_usage("");  # Use default resource bundle
    8080    die "\n";
    8181    }
Note: See TracChangeset for help on using the changeset viewer.