From ac84fb0e07377e6ecb9a823b3ae95c52d4d2a834 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Mon, 16 Aug 2010 11:30:59 +0200 Subject: [PATCH] locale files nicht mit hardcoded latin markieren sondern mit dem language charset. Ausserdem Markierungen auf vim ausgeweitet. --- locale/de/all | 3 ++- scripts/locales.pl | 10 +++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) 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 -- 2.20.1