unlink "$locales_dir/lost";
}
+my $charset = slurp("$locales_dir/charset") || 'utf-8';
+chomp $charset;
+
my %old_texts = %{ $self->{texts} || {} };
map({ handle_file($_, $bindir); } @progfiles);
EOL
$LOST_HEADER = <<EOL;
# The last 50 text strings, that have been removed.
-# This file is auto-generated by locales.pl. Do not edit it.
+# This file has been auto-generated by locales.pl. Please don't edit!
EOL
}
while ($line =~ m/\[\%[^\w]*(\w+)\.\w+\(/g) {
my $plugin = $1;
- $plugins{needed}->{$plugin} = 1 if (first { $_ eq $plugin } qw(HTML LxERP JavaScript MultiColumnIterator));
+ $plugins{needed}->{$plugin} = 1 if (first { $_ eq $plugin } qw(HTML LxERP JavaScript MultiColumnIterator L));
}
while ($line =~ m/(?: # Start von Variante 1: LxERP.t8('...'); ohne darumliegende [% ... %]-Tags
sub _single_quote {
my $val = shift;
- $val =~ s/('|\\$)/\\$1/g;
+ $val =~ s/(\'|\\$)/\\$1/g;
return "'" . $val . "'";
}
open my $fh, '>', $file or die "$! : $file";
- print $fh "#!/usr/bin/perl\n# -*- coding: iso-8859-15; -*-\n\n";
+ my $emacs_charset = lc $charset;
+
+ print $fh "#!/usr/bin/perl\n# -*- coding: $emacs_charset; -*-\n# vim: fenc=$charset\n\n";
print $fh $header, "\n" if $header;
print $fh "$data_name = $delim[0]\n" if $data_name;
close $fh;
}
+sub slurp {
+ my $file = shift;
+ do { local ( @ARGV, $/ ) = $file; <> }
+}
+
__END__
=head1 NAME