From: Moritz Bunkus Date: Thu, 7 Mar 2013 12:41:36 +0000 (+0100) Subject: JS-Locales: Ausgabedateinamen richtig ermitteln X-Git-Tag: release-3.1.0beta1~547 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=bc08036a5ad1922e30ddd6f69268438c0b86883f;p=kivitendo-erp.git JS-Locales: Ausgabedateinamen richtig ermitteln --- 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 {