From: Bernd Bleßmann Date: Thu, 7 Jan 2021 17:30:32 +0000 (+0100) Subject: locales-Skript: all/more berücksichtigen, … X-Git-Tag: kivitendo-mebil_0.1-0~9^2~536 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=7438b9e6905ed2fed867357609f7627cd79d4c25;p=kivitendo-erp.git locales-Skript: all/more berücksichtigen, … indem Texte, die ausschließlich dort vorhanden sind, nicht in all eingetragen werden. Texte, die vorher schon in all sind, bleiben aber erhalten. Das sind dann (vermutlich) die Texte, die in more für ein Kundenprojekt eine andere Übersetzung haben sollen (und nicht neu hinzu kamen). --- diff --git a/scripts/locales.pl b/scripts/locales.pl index c81f7b41c..7891fe9c4 100755 --- a/scripts/locales.pl +++ b/scripts/locales.pl @@ -144,12 +144,18 @@ for my $file_name (grep { /\.(?:js|html)$/i } map({find_files($_)} @javascript_d # merge entries to translate with entries from files 'missing' and 'lost' merge_texts(); -# generate all +# Generate "all" without translations in more_texts. +# But keep the ones which are in both old_texts (texts) and more_texts, +# because this are ones which are overwritten in more_texts for custom usage. +my %to_keep; +$to_keep{$_} = 1 for grep { !!$self->{more_texts}{$_} } keys %old_texts; +my @new_all = grep { $to_keep{$_} || !$self->{more_texts}{$_} } sort keys %alllocales; + generate_file( file => "$locales_dir/all", header => $ALL_HEADER, data_name => '$self->{texts}', - data_sub => sub { _print_line($_, $self->{texts}{$_}, @_) for sort keys %alllocales }, + data_sub => sub { _print_line($_, $self->{texts}{$_}, @_) for @new_all }, ); open(my $js_file, '>:encoding(utf8)', $javascript_output_dir .'/locale/'. $locale .'.js') || die;