X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=scripts%2Flocales.pl;h=ff2638b627f9da9c8f873ac8db6f0e66c0a673ae;hb=203ebd4a71a8de7d549db868b657232da36b6e82;hp=d156ddd03045f8a6d24319c8fc355d34b20ae978;hpb=ec5558685b18db2407692464a0f3a6d022b9a845;p=kivitendo-erp.git diff --git a/scripts/locales.pl b/scripts/locales.pl index d156ddd03..ff2638b62 100755 --- a/scripts/locales.pl +++ b/scripts/locales.pl @@ -6,6 +6,7 @@ # this version of locles processes not only all required .pl files # but also all parse_html_templated files. +use utf8; use strict; use Data::Dumper; @@ -474,26 +475,26 @@ sub scanhtmlfile { 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 (LxERP\.t8)\( # LxERP.t8( ::Parameter $1:: - ([\'\"]) # Anfang des zu übersetzenden Strings ::Parameter $2:: - (.*?) # Der zu übersetzende String ::Parameter $3:: - (?', $file or die "$! : $file"; + open my $fh, '>:encoding(utf8)', $file or die "$! : $file"; - print $fh "#!/usr/bin/perl\n# -*- coding: $charset; -*-\n# vim: fenc=$charset\n\n"; + $charset =~ s/\r?\n//g; + my $emacs_charset = lc $charset; + + print $fh "#!/usr/bin/perl\n# -*- coding: $emacs_charset; -*-\n# vim: fenc=$charset\n\nuse utf8;\n\n"; print $fh $header, "\n" if $header; print $fh "$data_name = $delim[0]\n" if $data_name;