Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 7438b9e6

Von Bernd Bleßmann vor mehr als 3 Jahren hinzugefügt

  • ID 7438b9e6905ed2fed867357609f7627cd79d4c25
  • Vorgänger 66446327
  • Nachfolger dfdb5c36

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).

Unterschiede anzeigen:

scripts/locales.pl
144 144
# merge entries to translate with entries from files 'missing' and 'lost'
145 145
merge_texts();
146 146

  
147
# generate all
147
# Generate "all" without translations in more_texts.
148
# But keep the ones which are in both old_texts (texts) and more_texts,
149
# because this are ones which are overwritten in more_texts for custom usage.
150
my %to_keep;
151
$to_keep{$_} = 1 for grep { !!$self->{more_texts}{$_} } keys %old_texts;
152
my @new_all  = grep { $to_keep{$_} || !$self->{more_texts}{$_} } sort keys %alllocales;
153

  
148 154
generate_file(
149 155
  file      => "$locales_dir/all",
150 156
  header    => $ALL_HEADER,
151 157
  data_name => '$self->{texts}',
152
  data_sub  => sub { _print_line($_, $self->{texts}{$_}, @_) for sort keys %alllocales },
158
  data_sub  => sub { _print_line($_, $self->{texts}{$_}, @_) for @new_all },
153 159
);
154 160

  
155 161
open(my $js_file, '>:encoding(utf8)', $javascript_output_dir .'/locale/'. $locale .'.js') || die;

Auch abrufbar als: Unified diff