From bc08036a5ad1922e30ddd6f69268438c0b86883f Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Thu, 7 Mar 2013 13:41:36 +0100 Subject: [PATCH] JS-Locales: Ausgabedateinamen richtig ermitteln --- scripts/locales.pl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/locales.pl b/scripts/locales.pl index b6cccf118..d7b28a3db 100755 --- a/scripts/locales.pl +++ b/scripts/locales.pl @@ -10,6 +10,7 @@ use utf8; use strict; use Carp; +use Cwd; use Data::Dumper; use English; use File::Slurp qw(slurp); @@ -141,7 +142,7 @@ generate_file( data_sub => sub { _print_line($_, $self->{texts}{$_}, @_) for sort keys %alllocales }, ); -open(my $js_file, '>:encoding(utf8)', $javascript_output_dir .'/locale/'. $locale .'js') || die; +open(my $js_file, '>:encoding(utf8)', $javascript_output_dir .'/locale/'. $locale .'.js') || die; print $js_file '{'; my $first_entry = 1; for my $key (sort(keys(%jslocale))) { @@ -267,6 +268,9 @@ sub parse_args { . "and no locale directory name was given.\n"; exit 1; } + + $locale ||= (grep { $_ } split m:/:, getcwd())[-1]; + $locale =~ s/\.+$//; } sub handle_file { -- 2.20.1