]> git.deb.at Git - deb/packages.git/blobdiff - bin/create_index_pages
Make HTML shared templates translatable
[deb/packages.git] / bin / create_index_pages
index 8586671bdbbffb52616d7d331ab4d6255ebb02f1..9beac92d98d3b6fcb6c95f8090929f6aba670561 100755 (executable)
@@ -28,6 +28,7 @@ delete $ENV{'LC_ALL'};
 delete $ENV{'LC_MESSAGES'};
 bindtextdomain ( 'pdo', $LOCALES );
 bindtextdomain ( 'sections', $LOCALES );
+bindtextdomain ( 'templates', $LOCALES );
 textdomain( 'pdo' );
 
 my $wwwdir = "$TOPDIR/www";
@@ -53,6 +54,7 @@ my (%pages, %tt_vars);
 
 $tt_vars{make_search_url} = sub { return &Packages::CGI::make_search_url(@_) };
 $tt_vars{make_url} = sub { return &Packages::CGI::make_url(@_) };
+$tt_vars{g} = sub { return &Packages::I18N::Locale::tt_gettext(@_) };
 # needed to work around the limitations of the the FILTER syntax
 $tt_vars{html_encode} = sub { return HTML::Entities::encode_entities(@_,'<>&"') };
 $tt_vars{uri_escape} = sub { return URI::Escape::uri_escape(@_) };
@@ -67,7 +69,7 @@ foreach my $s (@SUITES) {
     mkpath ( "$wwwdir/source/$key" );
     foreach my $lang (@LANGUAGES) {
        my $locale = get_locale( $lang );
-       my $charset = get_locale( $lang );
+       my $charset = get_charset( $lang );
        setlocale ( LC_ALL, $locale ) or do {
            warn "couldn't set locale ($lang/$locale)\n";
            next;