Initial checkin of upstream version 4.09.

Signed-off-by: Thomas Hochstein <thh@inter.net>
This commit is contained in:
Thomas Hochstein 2010-08-16 22:16:26 +02:00
commit ac7e2c541a
47 changed files with 8045 additions and 0 deletions

32
UVmessage.pm Normal file
View file

@ -0,0 +1,32 @@
# UVmessages: parses resource strings and substitutes variables
# Used by all components
package UVmessage;
use strict;
use vars qw(@ISA @EXPORT_OK $VERSION);
require Exporter;
@ISA = qw(Exporter);
@EXPORT_OK = qw(get);
# Module version
$VERSION = "0.1";
sub get {
my ($key, %param) = @_;
my $string = $UVconfig::messages{$key} || return '';
while ($string =~ m/\$\{([A-Za-z0-9_-]+)\}/) {
my $skey = $1;
my $sval = $param{$skey};
$sval = '' unless defined($sval);
$string =~ s/\$\{$skey\}/$sval/g;
}
return $string;
}
1;