From c33a41112917bdcb7ed76ebbb3821139df43c0c7 Mon Sep 17 00:00:00 2001 From: acli Date: Mon, 23 Feb 2004 22:16:08 +0000 Subject: [PATCH] The timestamps in the generated PO file should make a little bit more sense this way. In any case hard-coding a date didn't make any sense at all. --- misc/translator/tmpl_process3.pl | 1 + misc/translator/xgettext.pl | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/misc/translator/tmpl_process3.pl b/misc/translator/tmpl_process3.pl index 0dd4f0c30a..5445bf4b11 100755 --- a/misc/translator/tmpl_process3.pl +++ b/misc/translator/tmpl_process3.pl @@ -239,6 +239,7 @@ if ($action eq 'create') { close $tmph1; # Generate the temporary file that acts as /.pot my $st = system($xgettext, '-s', '-f', $tmpfile1, '-o', $tmpfile2, + '--po-mode', (defined $charset_in? ('-I', $charset_in): ()), (defined $charset_out? ('-O', $charset_out): ())); if ($st == 0) { diff --git a/misc/translator/xgettext.pl b/misc/translator/xgettext.pl index ee2aa338e0..fdce401e0d 100755 --- a/misc/translator/xgettext.pl +++ b/misc/translator/xgettext.pl @@ -8,6 +8,7 @@ xgettext.pl - xgettext(1)-like interface for .tmpl strings extraction use strict; use Getopt::Long; +use POSIX; use Locale::PO; use TmplTokenizer; use VerboseWarnings; @@ -19,6 +20,7 @@ use vars qw( $pedantic_p ); use vars qw( %text %translation ); use vars qw( $charset_in $charset_out ); use vars qw( $verbose_p ); +use vars qw( $po_mode_p ); ############################################################################### @@ -123,6 +125,10 @@ sub generate_po_file () { # We don't emit the Plural-Forms header; it's meaningless for us my $pot_charset = (defined $charset_out? $charset_out: 'CHARSET'); $pot_charset = TmplTokenizer::charset_canon $pot_charset; + # Time stamps aren't exactly right semantically. I don't know how to fix it. + my $time = POSIX::strftime('%Y-%m-%d %H:%M%z', localtime(time)); + my $time_pot = $time; + my $time_po = $po_mode_p? $time: 'YEAR-MO-DA HO:MI+ZONE'; print OUTPUT <\\n" "Language-Team: LANGUAGE \\n" "MIME-Version: 1.0\\n" @@ -255,6 +261,7 @@ GetOptions( 'pedantic-warnings|pedantic' => sub { $pedantic_p = 1 }, 'O|output-charset=s' => \$charset_out, # INTERNAL 'output|o=s' => \$output, + 'po-mode' => \$po_mode_p, # INTERNAL 's|sort-output' => sub { $sort = 's' }, 'F|sort-by-file' => sub { $sort = 'F' }, 'v|verbose' => \$verbose_p, -- 2.39.5