require "all";
}
+my %old_texts = %{ $self->{texts} };
+
# Read HTML templates.
#%htmllocale = ();
#@htmltemplates = <../../templates/webpages/*/*_master.html>;
}
+@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 = <FH>;
close(FH);