aboutsummaryrefslogtreecommitdiffstats
path: root/make_all.pl
diff options
context:
space:
mode:
authorJosip Rodin <joy>2001-08-09 22:33:16 +0000
committerJosip Rodin <joy>2001-08-09 22:33:16 +0000
commitcd4b9fa57d7d029a2a3c75c4975427d11065b144 (patch)
tree9576f1a729d8e94f86edad37476719e9c0ee8538 /make_all.pl
parentbec839f4588dcbbc87b512d443199d6a699dac67 (diff)
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)
Diffstat (limited to 'make_all.pl')
-rwxr-xr-xmake_all.pl91
1 files changed, 91 insertions, 0 deletions
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 <file1> <file2>...
+
+# This will update every version of <file?>, 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 (<SELF>)
+ {
+ 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";
+ }
+ }
+}

© 2014-2024 Faster IT GmbH | imprint | privacy policy