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/ImagePlug.pm

    r4790 r4873  
    3434my $arguments =
    3535    [ { 'name' => "process_exp",
    36     '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).",
     36    'desc' => "{BasPlug.process_exp}",
    3737    'type' => "string",
    3838    'deft' => &get_default_process_exp(),
    3939    'reqd' => "no" },
    4040      { 'name' => "noscaleup",
    41     'desc' => "Don't scale up small images when making thumbnails.",
     41    'desc' => "{ImagePlug.noscaleup}",
    4242    'type' => "flag",
    4343    'reqd' => "no" },
    4444      { 'name' => "thumbnailsize",
    45     'desc' => "Make thumbnails of size nxn.",
     45    'desc' => "{ImagePlug.thumbnailsize}",
    4646    'type' => "int",
    4747    'deft' => "100",
    4848    'reqd' => "no" },
    4949      { 'name' => "thumbnailtype",
    50     'desc' => "Make thumbnails in format 's'.",
     50    'desc' => "{ImagePlug.thumbnailtype}",
    5151    'type' => "string",
    5252    'deft' => "gif",
    5353    'reqd' => "no" },
    5454      { 'name' => "screenviewsize",
    55     'desc' => "If set, makes an image of size n for screen display and sets Screen, ScreenSize, ScreenWidth and ScreenHeight metadata.  By default it is not set.",
     55    'desc' => "{ImagePlug.screenviewsize}",
    5656    'type' => "int",
    5757    'deft' => "0",
    5858    'reqd' => "no" },
    5959      { 'name' => "screenviewtype",
    60     'desc' => "If -screenviewsize is set, this sets the screen display image type.",
     60    'desc' => "{ImagePlug.screenviewtype}",
    6161    'type' => "string",
    6262    'deft' => "jpg",
    6363    'reqd' => "no" },
    6464      { 'name' => "converttotype",
    65     'desc' => "Convert main image to.",
     65    'desc' => "{ImagePlug.converttotype}",
    6666    'type' => "string",
    6767    'deft' => "",
    6868    'reqd' => "no" },
    6969      { 'name' => "minimumsize",
    70     'desc' => "Ignore images smaller than n bytes.",
     70    'desc' => "{ImagePlug.minimumsize}",
    7171    'type' => "int",
    7272    'deft' => "100",
     
    127127    print STDERR "\nImagePlug uses an incorrect option.\n";
    128128    print STDERR "Check your collect.cfg configuration file.\n";
    129     $self->print_txt_usage();
     129    $self->print_txt_usage("");  # Use default resource bundle
    130130    die "\n";
    131131    }
Note: See TracChangeset for help on using the changeset viewer.