Revision 984d50b3
Von Moritz Bunkus vor mehr als 14 Jahren hinzugefügt
scripts/locales.pl | ||
---|---|---|
23 | 23 |
my $opt_v = 0; |
24 | 24 |
my $opt_n = 0; |
25 | 25 |
my $opt_c = 0; |
26 |
my $lang; |
|
27 | 26 |
my $debug = 0; |
28 | 27 |
|
29 | 28 |
parse_args(); |
30 | 29 |
|
31 |
my $basedir = "."; |
|
32 |
my $locales_dir = "$basedir/locale/$lang";
|
|
30 |
my $basedir = "../..";
|
|
31 |
my $locales_dir = ".";
|
|
33 | 32 |
my $bindir = "$basedir/bin/mozilla"; |
34 | 33 |
my $dbupdir = "$basedir/sql/Pg-upgrade"; |
35 | 34 |
my $dbupdir2 = "$basedir/sql/Pg-upgrade2"; |
... | ... | |
185 | 184 |
exit 0; |
186 | 185 |
} |
187 | 186 |
|
188 |
$lang = shift @ARGV || croak 'need language code as argument'; |
|
187 |
if (@ARGV) { |
|
188 |
my $arg = shift @ARGV; |
|
189 |
my $ok = 0; |
|
190 |
foreach my $dir ("../locale/$arg", "locale/$arg", "../$arg", $arg) { |
|
191 |
next unless -d $dir && -f "$dir/all" && -f "$dir/LANGUAGE"; |
|
192 |
$ok = chdir $dir; |
|
193 |
last; |
|
194 |
} |
|
195 |
|
|
196 |
if (!$ok) { |
|
197 |
print "The locale directory '$arg' could not be found.\n"; |
|
198 |
exit 1; |
|
199 |
} |
|
200 |
|
|
201 |
} elsif (!-f 'all' || !-f 'LANGUAGE') { |
|
202 |
print "locales.pl was not called from a locale/* subdirectory,\n" |
|
203 |
. "and no locale directory name was given.\n"; |
|
204 |
exit 1; |
|
205 |
} |
|
189 | 206 |
} |
190 | 207 |
|
191 | 208 |
sub handle_file { |
Auch abrufbar als: Unified diff
scripts/locales.pl mit und ohne Argument ausführbar gemacht
Das locales.pl-Script kann wie folgt aufgerufen werden:
1. Aus einem locale-Unterverzeichnis, in dem 'all' und 'LANGUAGE'
existieren:
cd locale/de
../../scripts/locales.pl
2. Aus einem beliebigen Verzeichnis unter Angabe des Sprachkürzels:
./scripts/locales.pl de
3. Aus einem beliebigen Verzeichnis unter Angabe des relativen oder
absoluten Pfades zum locale-Unterverzeichnis:
./scripts/locales.pl ./locale/de
Conflicts: