From 8a149560b608bd7fed773adfc39ef44b2dc3e072 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Thu, 24 Jan 2008 17:14:10 +0000 Subject: [PATCH] =?utf8?q?Die=20letzten=2050=20=C3=9Cbersetzungen,=20die?= =?utf8?q?=20von=20locales.pl=20nicht=20mehr=20gefunden=20werden,=20werden?= =?utf8?q?=20in=20der=20Datei=20"lost"=20protokolliert,=20damit=20man=20im?= =?utf8?q?=20Falle=20eines=20Verschreibers=20leicht=20wieder=20an=20die=20?= =?utf8?q?=C3=9Cbersetzung=20herankommt.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- locale/de/locales.pl | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/locale/de/locales.pl b/locale/de/locales.pl index b6ef75cd7..a655bdcb5 100755 --- a/locale/de/locales.pl +++ b/locale/de/locales.pl @@ -64,6 +64,8 @@ if (-f 'all') { require "all"; } +my %old_texts = %{ $self->{texts} }; + # Read HTML templates. #%htmllocale = (); #@htmltemplates = <../../templates/webpages/*/*_master.html>; @@ -251,6 +253,38 @@ $missing = { } +@lost = (); + +if (-f "lost") { + require "lost"; + unlink "lost"; +} + +while (($text, $translation) = each %old_texts) { + next if ($alllocales{$text}); + + push @lost, { 'text' => $text, 'translation' => $translation }; +} + +if (scalar @lost) { + splice @lost, 0, (scalar @lost - 50) if (scalar @lost > 50); + + open FH, ">lost"; + print FH "#!/usr/bin/perl\n\n" . + "# The last 50 texts that have been removed.\n" . + "# This file will be auto-generated by locales.pl. Do not edit it.\n\n" . + "\@lost = (\n"; + + foreach $entry (@lost) { + $entry->{text} =~ s/\'/\\\'/; + $entry->{translation} =~ s/\'/\\\'/; + print FH " { 'text' => '$entry->{text}', 'translation' => '$entry->{translation}' },\n"; + } + + print FH ");\n\n1;\n"; + close FH; +} + open(FH, "LANGUAGE"); @language = ; close(FH); -- 2.20.1