Revision 8a149560
Von Moritz Bunkus vor fast 17 Jahren hinzugefügt
locale/de/locales.pl | ||
---|---|---|
64 | 64 |
require "all"; |
65 | 65 |
} |
66 | 66 |
|
67 |
my %old_texts = %{ $self->{texts} }; |
|
68 |
|
|
67 | 69 |
# Read HTML templates. |
68 | 70 |
#%htmllocale = (); |
69 | 71 |
#@htmltemplates = <../../templates/webpages/*/*_master.html>; |
... | ... | |
251 | 253 |
|
252 | 254 |
} |
253 | 255 |
|
256 |
@lost = (); |
|
257 |
|
|
258 |
if (-f "lost") { |
|
259 |
require "lost"; |
|
260 |
unlink "lost"; |
|
261 |
} |
|
262 |
|
|
263 |
while (($text, $translation) = each %old_texts) { |
|
264 |
next if ($alllocales{$text}); |
|
265 |
|
|
266 |
push @lost, { 'text' => $text, 'translation' => $translation }; |
|
267 |
} |
|
268 |
|
|
269 |
if (scalar @lost) { |
|
270 |
splice @lost, 0, (scalar @lost - 50) if (scalar @lost > 50); |
|
271 |
|
|
272 |
open FH, ">lost"; |
|
273 |
print FH "#!/usr/bin/perl\n\n" . |
|
274 |
"# The last 50 texts that have been removed.\n" . |
|
275 |
"# This file will be auto-generated by locales.pl. Do not edit it.\n\n" . |
|
276 |
"\@lost = (\n"; |
|
277 |
|
|
278 |
foreach $entry (@lost) { |
|
279 |
$entry->{text} =~ s/\'/\\\'/; |
|
280 |
$entry->{translation} =~ s/\'/\\\'/; |
|
281 |
print FH " { 'text' => '$entry->{text}', 'translation' => '$entry->{translation}' },\n"; |
|
282 |
} |
|
283 |
|
|
284 |
print FH ");\n\n1;\n"; |
|
285 |
close FH; |
|
286 |
} |
|
287 |
|
|
254 | 288 |
open(FH, "LANGUAGE"); |
255 | 289 |
@language = <FH>; |
256 | 290 |
close(FH); |
Auch abrufbar als: Unified diff
Die letzten 50 Übersetzungen, die von locales.pl nicht mehr gefunden werden, werden in der Datei "lost" protokolliert, damit man im Falle eines Verschreibers leicht wieder an die Übersetzung herankommt.