[Po4a-commits] po4a/lib/Locale/Po4a Common.pm,1.1,1.2

Jordi Vilalta po4a-devel@lists.alioth.debian.org
Sat, 05 Feb 2005 11:54:59 +0000


Update of /cvsroot/po4a/po4a/lib/Locale/Po4a
In directory haydn:/tmp/cvs-serv30429/lib/Locale/Po4a

Modified Files:
	Common.pm 
Log Message:
If we don't get a module name, show the message like wrap_mod does


Index: Common.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/Common.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- Common.pm	4 Feb 2005 23:35:11 -0000	1.1
+++ Common.pm	5 Feb 2005 11:54:57 -0000	1.2
@@ -104,10 +104,15 @@
     my ($ref, $mod, $msg) = (shift, shift, shift);
     my @args = @_;
 
-    $ref .= ": ";
-    my $spaces = " " x min(length($ref), 15);
-    $msg = "$ref($mod)\n$msg";
-    return wrap("", $spaces, sprintf($msg, @args))."\n";
+    if (!$mod) {
+	# If we don't get a module name, show the message like wrap_mod does
+	return wrap_mod($ref, $msg, @args);
+    } else {
+	$ref .= ": ";
+	my $spaces = " " x min(length($ref), 15);
+	$msg = "$ref($mod)\n$msg";
+	return wrap("", $spaces, sprintf($msg, @args))."\n";
+    }
 }
 
 1;