Index: po4a =================================================================== RCS file: /cvsroot/po4a/po4a/po4a,v retrieving revision 1.26 diff -u -r1.26 po4a --- po4a 4 Mar 2005 16:40:40 -0000 1.26 +++ po4a 16 Apr 2005 07:49:06 -0000 @@ -321,6 +321,10 @@ } elsif ($cmd =~ m/type: *(.*)/) { $document{$main}{'format'} = $1; + if ($args =~ m/^(.*) modopt:(.*)$/) { + $args = $1; + $document{$main}{'modopt'} = $2; + } foreach my $arg (split(/ /,$args)) { die wrap_ref_mod("$config_file:$nb", "", gettext("Unparsable argument '%s' (%s)."), $arg, $line) @@ -362,7 +366,15 @@ my $potfile=Locale::Po4a::Po->new(); foreach my $master (keys %document) { - my $doc=Locale::Po4a::Chooser::new($document{$master}{'format'},%options); + my %master_options = %options; + foreach (split (/ /, $document{$master}{'modopt'})) { + if (m/^([^=]*)=(.*)$/) { + $master_options{$1}="$2"; + } else { + $master_options{$_}=1; + } + } + my $doc=Locale::Po4a::Chooser::new($document{$master}{'format'},%master_options); # We ensure that the generated po will be in utf-8 if the input document # isn't entirely in ascii $doc->{TT}{utf_mode} = 1; @@ -441,7 +453,15 @@ DOC: foreach my $master (sort keys %document) { next unless defined $document{$master}{$lang}; - my $doc=Locale::Po4a::Chooser::new($document{$master}{'format'} ,%options); + my %master_options = %options; + foreach (split (/ /, $document{$master}{'modopt'})) { + if (m/^([^=]*)=(.*)$/) { + $master_options{$1}="$2"; + } else { + $master_options{$_}=1; + } + } + my $doc=Locale::Po4a::Chooser::new($document{$master}{'format'},%master_options); my (@file_in_name,@po_in_name); push @file_in_name, $master;