]> git.deb.at Git - deb/packages.git/commitdiff
Packages::Template: Always provide a fallback g() function
authorFrank Lichtenheld <frank@lichtenheld.de>
Wed, 23 Apr 2008 02:42:55 +0000 (04:42 +0200)
committerFrank Lichtenheld <frank@lichtenheld.de>
Wed, 23 Apr 2008 02:42:55 +0000 (04:42 +0200)
This will only get used if no catalogue is specified.
Fixes the about/debtags page.

lib/Packages/Template.pm

index c2919f1973de710a4f653fae67272f5a3edeee50..b48e69001543a98e83503231af09048e6a953a3d 100644 (file)
@@ -35,6 +35,7 @@ sub new {
     };
     $vars->{make_search_url} = sub { return &Packages::CGI::make_search_url(@_) };
     $vars->{make_url} = sub { return &Packages::CGI::make_url(@_) };
+    $vars->{g} = sub { my ($f, @a) = @_; return sprintf($f, @a); };
     if ($vars->{cat}) {
        $vars->{g} = sub { return Packages::I18N::Locale::g($vars->{cat}, @_) };
     }