From cd4b9fa57d7d029a2a3c75c4975427d11065b144 Mon Sep 17 00:00:00 2001 From: Josip Rodin Date: Thu, 9 Aug 2001 22:33:16 +0000 Subject: renamed new_translation.pl to make_all.pl, since it does different things; made it make the destination file, not the file in the source directory CVS version numbers make_all.pl: INITIAL -> 1.1 new_translation.pl: 1.5 -> 1.6(DEAD) --- make_all.pl | 91 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100755 make_all.pl (limited to 'make_all.pl') diff --git a/make_all.pl b/make_all.pl new file mode 100755 index 00000000000..a9c2a064242 --- /dev/null +++ b/make_all.pl @@ -0,0 +1,91 @@ +#!/usr/bin/perl -w + +# Usage: new_translation.pl ... + +# This will update every version of , each of which should be +# the path to a .wml file (without the language directory). + +# Note: this script old functionality is replaced by touch_old_files.pl + +require 5.001; +use strict; + +my (@languages, @parts, $file, $filename, $lang, $path, $pid); + +# from english/template/debian/languages.wml +# TODO: Needs to be synced frequently or fixed so it's automatic +my %langs = ( english => "en", +# arabic => "ar", + catalan => "ca", + danish => "da", + german => "de", + greek => "el", + esperanto => "eo", + spanish => "es", + finnish => "fi", + french => "fr", + croatian => "hr", + hungarian => "hu", + italian => "it", + japanese => "ja", + korean => "ko", + dutch => "nl", + norwegian => "no", + polish => "pl", + portuguese => "pt", + romanian => "ro", + russian => "ru", + swedish => "sv", + turkish => "tr", + chinese => "zh", +); + +if (!@ARGV) { + open SELF, "<$0" or die "Unable to display help: $!\n"; + HELP: while () + { + last HELP if (/^require/); + s/^# ?//; + next if /^!/; + print; + } + exit; +} + +opendir(DIR, ".") || die "can't open directory $!"; +@languages = grep { /^\w+$/ && -d $_ } readdir(DIR); +closedir DIR; +# print @languages; + +my $relhtmlbase = "../debian.org/"; + +foreach $file (@ARGV) { + $file =~ s,^english/,,; + my $level = 0; + my $destfile = ""; + my @parts = split '/', $file; + my $dir = pop @parts; + my $path = join '/', @parts; +# system ("mkdir -p $relhtmlbase$path"); + while ($dir) { $destfile .= "../"; $dir = pop @parts; } + $destfile .= $relhtmlbase . $file; + foreach $lang (@languages) { + next if ($lang eq "CVS"); + if ( -f "$lang/$file" ) { + $pid = fork; + if ($pid) { # parent + # do nothing + } + else { # child + $destfile =~ s/.wml$/.$langs{$lang}.html/; + print "Making the " . ucfirst $lang . " copy:\n"; + system("make -C $lang/$path $destfile") == 0 or die "$!\n"; + exit 0; + } + waitpid($pid,0); + } + else { + print "The file isn't translated into " . ucfirst $lang . ".\n"; + } + } +} -- cgit v1.2.3