From: Rich Bowen Date: Mon, 29 Nov 2010 14:18:17 +0000 (+0000) Subject: Move this into the build tree. X-Git-Tag: 2.3.10~150 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1e193225ef609f3a11a705407da1f938e504d4a2;p=apache Move this into the build tree. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1040117 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/docs/review_translations.pl b/docs/review_translations.pl deleted file mode 100755 index ad2edf83f3..0000000000 --- a/docs/review_translations.pl +++ /dev/null @@ -1,116 +0,0 @@ -#!/opt/local/bin/perl -use XML::Simple; -use Getopt::Std; -use File::Glob; -use Data::Dumper; -use strict; - -our ( $opt_m, $opt_x, $opt_l ); -our $VERSION = '0.01'; -our %LANGS = ( - 'fr' => 'French', - 'ja' => 'Japanese', - 'de' => 'German', - 'ko' => 'Korean', - 'tr' => 'Turkish' - ); - -getopts("xl:m:"); -HELP_MESSAGE() unless $opt_m; - -$opt_m =~ s/\.xml$//; -HELP_MESSAGE() unless -f $opt_m . '.xml'; - -my $eng = $opt_m . '.xml'; -my @files = glob $opt_m . '.xml.*'; - -my $xs = XML::Simple->new(); -my $eng_xml = $xs->XMLin( $eng ); - -print "This document defines the following directives:\n"; -my @directives; -foreach my $directive ( sort( keys %{ $eng_xml->{directivesynopsis} } ) ) { - push @directives, $directive; - print $directive . "\n"; -} -print "\n"; - -foreach my $file (@files) { - - next if $file =~ m/\.meta$/; - my $lang = $file; - $lang =~ s/.*\.([^.]+)$/$1/; - - if ( $opt_l ) { - next unless $lang eq $opt_l; - } - - print "Translation available in ". ($LANGS{$lang}?$LANGS{$lang}:$lang) ."\n"; - my $lang_xml = $xs->XMLin( $file ); - - my @missing; - foreach my $d ( @directives ) { - unless ( defined( $lang_xml->{directivesynopsis}->{$d} ) ) { - print "Translation does not define $d\n"; - push @missing, $d; - } - } - - if ( $opt_x && @missing ) { - print "\nPaste the following into the XML:\n\n"; - foreach my $d ( @missing ) { - directive_doc( $d, $eng_xml ) if $opt_x; - } - } - - print "\n\n"; -} - -sub directive_doc { - my ($d, $eng_xml) = @_; - - print "\n"; - print "" . $d . "\n"; - print "" . - $eng_xml->{directivesynopsis}->{$d}->{description} . - "\n"; - print ""; - - # If there's only one context, this is a scalar, not an arrayref. - if ( !ref( $eng_xml->{directivesynopsis}->{$d}->{contextlist}->{context}) ) { - $eng_xml->{directivesynopsis}->{$d}->{contextlist}->{context} - = [ $eng_xml->{directivesynopsis}->{$d}->{contextlist}->{context} ] - } - - 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~ - -Usage: - -cd manual/mod -../../review_translations.pl -m mod_rewrite - -Lists languages with available translations, and tells you what -directives are missing from each translation. - --m mod_foo - Run for mod_foo. - --x - Generate XML for missing directives, to be pasted into the -translation XML. - --l xx - Only look at document in language xx - -~; - - exit(); -} - -