[interchange-cvs] interchange - racke modified lib/Vend/Util.pm
interchange-core@icdevgroup.org
interchange-core@icdevgroup.org
Mon Nov 4 16:37:00 2002
User: racke
Date: 2002-11-04 21:36:38 GMT
Modified: lib/Vend Util.pm
Log:
use parse_locale function to avoid code duplication
Revision Changes Path
2.39 +3 -10 interchange/lib/Vend/Util.pm
rev 2.39, prev_rev 2.38
Index: Util.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Util.pm,v
retrieving revision 2.38
retrieving revision 2.39
diff -u -r2.38 -r2.39
--- Util.pm 5 Oct 2002 23:57:10 -0000 2.38
+++ Util.pm 4 Nov 2002 21:36:37 -0000 2.39
@@ -1,6 +1,6 @@
# Vend::Util - Interchange utility functions
#
-# $Id: Util.pm,v 2.38 2002/10/05 23:57:10 danb Exp $
+# $Id: Util.pm,v 2.39 2002/11/04 21:36:37 racke Exp $
#
# Copyright (C) 1996-2002 Red Hat, Inc. <interchange@redhat.com>
#
@@ -83,7 +83,7 @@
use Safe;
use subs qw(logError logGlobal);
use vars qw($VERSION @EXPORT @EXPORT_OK);
-$VERSION = substr(q$Revision: 2.38 $, 10);
+$VERSION = substr(q$Revision: 2.39 $, 10);
BEGIN {
eval {
@@ -1208,14 +1208,7 @@
(defined $loc ? $loc : $Vend::Cfg->{Locale}->{readfile} )
)
{
- my $key;
- $contents =~ s~\[L(\s+([^\]]+))?\]([\000-\377]*?)\[/L\]~
- $key = $2 || $3;
- defined $Vend::Cfg->{Locale}->{$key}
- ? ($Vend::Cfg->{Locale}->{$key}) : $3 ~eg;
- $contents =~ s~\[LC\]([\000-\377]*?)\[/LC\]~
- find_locale_bit($1) ~eg;
- undef $Lang;
+ parse_locale(\$contents);
}
return $contents;
}