From: Jan Büren Date: Tue, 18 Oct 2016 10:04:31 +0000 (+0200) Subject: Generierung des missing files von locales verbessert X-Git-Tag: release-3.5.4~1989 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=032056b31542fd4aeacfb313bb46467160ee3720;p=kivitendo-erp.git Generierung des missing files von locales verbessert Alle Übersetzungen die schon unterhalb von $locale/more/* gemacht worden sind, nicht mehr als nicht übersetzt in missing ausgeben. --- diff --git a/scripts/locales.pl b/scripts/locales.pl index 2c31f87b3..922f042b3 100755 --- a/scripts/locales.pl +++ b/scripts/locales.pl @@ -112,6 +112,18 @@ foreach my $sub_dir ("Pg-upgrade2", "Pg-upgrade2-auth") { if (-f "$locales_dir/all") { require "$locales_dir/all"; } +# load custom translation (more_texts) +for my $file (glob("${locales_dir}/more/*")) { + if (open my $in, "<", "$file") { + local $/ = undef; + my $code = <$in>; + eval($code); + close($in); + $self->{more_texts_temp}{$_} = $self->{more_texts}{$_} for keys %{ $self->{more_texts} }; + } +} +$self->{more_texts} = delete $self->{more_texts_temp}; + if (-f "$locales_dir/missing") { require "$locales_dir/missing" ; unlink "$locales_dir/missing"; @@ -164,7 +176,8 @@ close($js_file); # calc and generate missing -my @new_missing = grep { !$self->{texts}{$_} } sort keys %alllocales; +# don't add missing ones if we have a translation in more_texts +my @new_missing = grep { !$self->{more_texts}{$_} && !$self->{texts}{$_} } sort keys %alllocales; if (@new_missing) { if ($opt_c) {