-
- open(IN, $_[0]) || die;
-
- my $copying = 0;
- my $text = "";
- while (my $line = <IN>) {
- chomp($line);
-
- while ("" ne $line) {
- if (!$copying) {
- if ($line =~ m|<translate>|i) {
- substr($line, 0, $+[0]) = "";
- $copying = 1;
-
- } else {
- $line = "";
- }
-
- } else {
- if ($line =~ m|</translate>|i) {
- $text .= $`;
- substr($line, 0, $+[0]) = "";
- $copying = 0;
- $alllocales{$text} = 1;
- $htmllocale{$text} = 1;
- $text = "";
+
+ if (!defined $cached{$_[0]}) {
+
+ open(IN, $_[0]) || die $_[0];
+
+ my $copying = 0;
+ my $issubmit = 0;
+ my $text = "";
+ while (my $line = <IN>) {
+ chomp($line);
+
+ while ("" ne $line) {
+ if (!$copying) {
+ if ($line =~ m|<translate>|i) {
+ my $eom = $+[0];
+ if ($` =~ /$submitsearch/) {
+ $issubmit = 1
+ }
+ substr($line, 0, $eom) = "";
+ $copying = 1;
+ } else {
+ $line = "";
+ }