Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision b6ae20da

Von Moritz Bunkus vor mehr als 13 Jahren hinzugefügt

  • ID b6ae20da85f7c02f486dd7ba15713292b61017cb
  • Vorgänger 686cba23
  • Nachfolger 5d3d2de2

Alle Dateien in SL rekursiv nach Übersetzungen durchsuchen

Unterschiede anzeigen:

scripts/locales.pl
31 31
my $basedir      = "../..";
32 32
my $locales_dir  = ".";
33 33
my $bindir       = "$basedir/bin/mozilla";
34
my @progdirs     = ( "$basedir/SL/Controller", "$basedir/SL/Template/Plugin", "$basedir/SL/Auth" );
34
my @progdirs     = ( "$basedir/SL" );
35 35
my $dbupdir      = "$basedir/sql/Pg-upgrade";
36 36
my $dbupdir2     = "$basedir/sql/Pg-upgrade2";
37 37
my $menufile     = "menu.ini";
......
42 42

  
43 43
init();
44 44

  
45
opendir DIR, "$bindir" or die "$!";
46
my @progfiles = map { [ $_, $bindir ] } grep { /\.pl$/ && !/(_custom|^\.)/ } readdir DIR;
47
seekdir DIR, 0;
48
my @customfiles = grep /_custom/, readdir DIR;
49
closedir DIR;
45
sub find_files {
46
  my ($dir_name, $files) = @_;
50 47

  
51
foreach my $dir (@progdirs) {
52
  opendir DIR, $dir or die "$!";
53
  push @progfiles, map { [ $_, $dir ] } grep { /\.pm$/ } readdir DIR;
54
  closedir DIR;
48
  $files ||= [];
49

  
50
  my @dirs_to_check;
51

  
52
  opendir my $dir, $dir_name or die "$! $dir_name";
53

  
54
  foreach my $name (readdir $dir) {
55
    next if $name eq '.' || $name eq '..';
56

  
57
    my $full_name = "${dir_name}/${name}";
58
    if (-d $full_name) {
59
      push @dirs_to_check, $full_name;
60
    } else {
61
      push @{ $files }, $full_name;
62
    }
63
  }
64

  
65
  closedir $dir;
66

  
67
  map { find_files($_, $files) } @dirs_to_check;
68

  
69
  return @{ $files };
55 70
}
56 71

  
72
my @bindir_files = find_files($bindir);
73
my @progfiles    = map { m:^(.+)/([^/]+)$:; [ $2, $1 ]  } grep { /\.pl$/ && !/_custom/ } @bindir_files;
74
my @customfiles  = grep /_custom/, @bindir_files;
75

  
76
push @progfiles, map { m:^(.+)/([^/]+)$:; [ $2, $1 ] } grep { /\.pm$/ } map { find_files($_) } @progdirs;
77

  
57 78
# put customized files into @customfiles
58 79
my @menufiles;
59 80

  

Auch abrufbar als: Unified diff