3 # translate english F*EX files into locale languange, debian special
30 $tr = "$source/locale/translations";
33 unless (-l "$dest/english") {
34 symlink '..',"$dest/english"
35 or die "$0: cannot symlink $dest/english - $!\n";
38 foreach $lang (glob "$source/locale/*/lib/fup.pl") {
39 $lang =~ s:.*/locale/::;
41 next if $lang eq 'english';
42 next if $lang =~ /_$/;
45 open $tr,$tr or die "$0: cannot open $tr - $!\n";
52 if (/^#\s*([\w-]+):/ and $lang eq $1) {
64 die "$0: syntax error in $tr line $. : no text\n";
67 for my $l (2 .. $ll) {
71 die "$0: syntax error in $tr line $. : no text\n";
75 while (<$tr>) { last if /^\s*$/ }
79 @E = sort {length $b <=> length $a} keys %T;
81 foreach $file (@trfiles) {
83 mkdirp("$dest/$lang/".dirname($file));
84 $fe = "$source/$file";
85 $ft = "$dest/$lang/$file";
86 open $fe,"<$fe" or die "$0: cannot read $fe - $!\n";
87 open $ft,">$ft" or die "$0: cannot write $ft - $!\n";
95 chmod((stat $fe)[2],$ft);
96 print "$ft written\n";
99 foreach $file (@cpfiles) {
100 $fs = "$source/locale/$lang/$file";
101 $fd = "$dest/$lang/$file";
102 mkdirp(dirname($fd));
103 $fd .= '_new' if -f $fd;
105 chmod((stat $fs)[2],$fd);
106 print "$fd written\n";
110 foreach $fs (qw(dop fex.ph)) {
111 $fd = "$dest/$lang/lib/$fs";
112 symlink "$FEXHOME/lib/$fs",$fd or die "$0: cannot symlink $fd - $!\n";
113 print "$fd linked\n";
124 die "$0: cannot mkdir /\n" unless $dir;
126 if ($pdir =~ s:/[^/]+$::) {
127 mkdirp($pdir) unless -d $pdir;
130 mkdir $dir,0755 or die "$0: mkdir $dir - $!\n";