From 0516ab23c8555fe2e9e1b7bb1b3e1ef6f835a2f5 Mon Sep 17 00:00:00 2001 From: Rich Bowen Date: Fri, 26 Nov 2010 18:42:02 +0000 Subject: [PATCH] Adds -x option to generate skeleton doc to paste into XML. Possibly alert someone that a translation is needed, and get more folks involved in the translation effort. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1039505 13f79535-47bb-0310-9956-ffa450edef68 --- docs/review_translations.pl | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/docs/review_translations.pl b/docs/review_translations.pl index c758ae8980..e1b9528b4c 100755 --- a/docs/review_translations.pl +++ b/docs/review_translations.pl @@ -13,7 +13,7 @@ our %LANGS = ( 'de' => 'German', ); -getopt("xlm:"); +getopts("xl:m:"); HELP_MESSAGE() unless $opt_m; $opt_m =~ s/\.xml$//; @@ -27,7 +27,7 @@ my $eng_xml = $xs->XMLin( $eng ); print "This document defines the following directives:\n"; my @directives; -foreach my $directive ( keys %{ $eng_xml->{directivesynopsis} } ) { +foreach my $directive ( sort( keys %{ $eng_xml->{directivesynopsis} } ) ) { push @directives, $directive; print $directive . "\n"; } @@ -47,12 +47,33 @@ foreach my $file (@files) { my $lang_xml = $xs->XMLin( $file ); foreach my $d ( @directives ) { - print "Translation does not define $d\n" unless defined( $lang_xml->{directivesynopsis}->{$d} ); + unless ( defined( $lang_xml->{directivesynopsis}->{$d} ) ) { + print "Translation does not define $d\n"; + directive_doc( $d, $eng_xml ) if $opt_x; + } } print "\n\n"; } +sub directive_doc { + my ($d, $eng_xml) = @_; +# print Dumper( $eng_xml->{directivesynopsis}->{$d} ); + + print "\nPaste the following into the XML:\n\n"; + print "\n"; + print "" . $d . "\n"; + print "" . + $eng_xml->{directivesynopsis}->{$d}->{description} . + "\n"; + print ""; + foreach my $c ( @{ $eng_xml->{directivesynopsis}->{$d}->{contextlist}->{context} } ) { + print "".$c.""; + } + print "\n"; + print "Documentation not yet translated. Please see English version of document.\n"; + print "\n\n"; +} sub HELP_MESSAGE { print STDERR qq~ -- 2.40.0