mirror of
https://github.com/Mibew/i18n.git
synced 2025-01-23 13:50:30 +03:00
2f2120e21a
git-svn-id: https://webim.svn.sourceforge.net/svnroot/webim/trunk@617 c66351dc-e62f-0410-b875-e3a5c0b9693f
34 lines
630 B
Perl
Executable File
34 lines
630 B
Perl
Executable File
#!/usr/bin/perl
|
|
|
|
sub sort_transl($) {
|
|
my($from) = @_;
|
|
my @translation = ();
|
|
my $header = "";
|
|
open(IN, "$from");
|
|
while(<IN>) {
|
|
chomp;
|
|
my $curr = $_;
|
|
if(/^([\w\.]+)=(.*)$/) {
|
|
if($1 ne "encoding" && $1 ne "output_charset" && $1 ne "output_encoding") {
|
|
push @translation, $curr;
|
|
} else {
|
|
$header .= "$curr\n";
|
|
}
|
|
} else {
|
|
die "wrong line in $from: $curr\n";
|
|
}
|
|
}
|
|
close(IN);
|
|
open(OUT, "> $from");
|
|
print OUT $header;
|
|
for$line(sort @translation) {
|
|
print OUT "$line\n";
|
|
}
|
|
close(OUT);
|
|
}
|
|
|
|
die "no parameter\n" if $#ARGV < 0;
|
|
die "doesn't exists\n" unless -e $ARGV[0];
|
|
|
|
sort_transl($ARGV[0]);
|