11 use Packages::CommonCode qw(:all);
12 use Packages::Config qw( $TOPDIR $DBDIR @ARCHIVES @SUITES @LANGUAGES );
13 use Packages::Template;
14 use Packages::I18N::Locale;
15 &Packages::Config::init( './' );
17 my $template = new Packages::Template( "$TOPDIR/templates", 'html');
20 die "usage: translate_static_page [[template outputfile]...]\n";
23 print "translate static pages ...\n";
24 while( my ($tmpl, $output) = each %pages ) {
25 my $outdir = dirname($output);
26 my $outfile = basename($output);
28 foreach my $lang (@LANGUAGES) {
29 my $charset = 'UTF-8';
30 my $cat = Packages::I18N::Locale->get_handle($lang)
31 or die "get_handle failed for $lang";
32 print "writing $outfile (lang=$lang)...\n";
34 my %content = ( po_lang => $lang, ddtp_lang => $lang,
35 charset => $charset, cat => $cat,
36 used_langs => \@LANGUAGES );
38 $template->page( $tmpl, \%content,
39 "$TOPDIR/$output.$lang.html.new");
40 activate( "$TOPDIR/$output.$lang.html" );