Revision bc08036a
Von Moritz Bunkus vor mehr als 11 Jahren hinzugefügt
scripts/locales.pl | ||
---|---|---|
10 | 10 |
use strict; |
11 | 11 |
|
12 | 12 |
use Carp; |
13 |
use Cwd; |
|
13 | 14 |
use Data::Dumper; |
14 | 15 |
use English; |
15 | 16 |
use File::Slurp qw(slurp); |
... | ... | |
141 | 142 |
data_sub => sub { _print_line($_, $self->{texts}{$_}, @_) for sort keys %alllocales }, |
142 | 143 |
); |
143 | 144 |
|
144 |
open(my $js_file, '>:encoding(utf8)', $javascript_output_dir .'/locale/'. $locale .'js') || die; |
|
145 |
open(my $js_file, '>:encoding(utf8)', $javascript_output_dir .'/locale/'. $locale .'.js') || die;
|
|
145 | 146 |
print $js_file '{'; |
146 | 147 |
my $first_entry = 1; |
147 | 148 |
for my $key (sort(keys(%jslocale))) { |
... | ... | |
267 | 268 |
. "and no locale directory name was given.\n"; |
268 | 269 |
exit 1; |
269 | 270 |
} |
271 |
|
|
272 |
$locale ||= (grep { $_ } split m:/:, getcwd())[-1]; |
|
273 |
$locale =~ s/\.+$//; |
|
270 | 274 |
} |
271 | 275 |
|
272 | 276 |
sub handle_file { |
Auch abrufbar als: Unified diff
JS-Locales: Ausgabedateinamen richtig ermitteln