From 032056b31542fd4aeacfb313bb46467160ee3720 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20B=C3=BCren?= Date: Tue, 18 Oct 2016 12:04:31 +0200 Subject: [PATCH] Generierung des missing files von locales verbessert MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Alle Übersetzungen die schon unterhalb von $locale/more/* gemacht worden sind, nicht mehr als nicht übersetzt in missing ausgeben. --- scripts/locales.pl | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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) { -- 2.20.1