From: Sven Schöling Date: Mon, 16 Aug 2010 09:30:59 +0000 (+0200) Subject: locale files nicht mit hardcoded latin markieren sondern mit dem language charset. X-Git-Tag: release-2.6.2beta1~180 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=ac84fb0e07377e6ecb9a823b3ae95c52d4d2a834;p=kivitendo-erp.git locale files nicht mit hardcoded latin markieren sondern mit dem language charset. Ausserdem Markierungen auf vim ausgeweitet. --- diff --git a/locale/de/all b/locale/de/all index 05e058de7..3b8685cb6 100644 --- a/locale/de/all +++ b/locale/de/all @@ -1,5 +1,6 @@ #!/usr/bin/perl -# -*- coding: iso-8859-15; -*- +# -*- coding: ISO-8859-15; -*- +# vim: fenc=ISO-8859-15 # These are all the texts to build the translations files. # The file has the form of 'english text' => 'foreign text', diff --git a/scripts/locales.pl b/scripts/locales.pl index 2174c2d81..21f424555 100755 --- a/scripts/locales.pl +++ b/scripts/locales.pl @@ -85,6 +85,9 @@ if (-f "$locales_dir/lost") { unlink "$locales_dir/lost"; } +my $charset = slurp("$locales_dir/charset") || 'utf-8'; +chomp $charset; + my %old_texts = %{ $self->{texts} || {} }; map({ handle_file($_, $bindir); } @progfiles); @@ -598,7 +601,7 @@ sub generate_file { open my $fh, '>', $file or die "$! : $file"; - print $fh "#!/usr/bin/perl\n# -*- coding: iso-8859-15; -*-\n\n"; + print $fh "#!/usr/bin/perl\n# -*- coding: $charset; -*-\n# vim: fenc=$charset\n\n"; print $fh $header, "\n" if $header; print $fh "$data_name = $delim[0]\n" if $data_name; @@ -608,6 +611,11 @@ sub generate_file { close $fh; } +sub slurp { + my $file = shift; + do { local ( @ARGV, $/ ) = $file; <> } +} + __END__ =head1 NAME