source: osm/applications/editors/josm/i18n/langinfo.pl@ 26987

Last change on this file since 26987 was 26987, checked in by stoecker, 13 years ago

add language file information tool

  • Property svn:executable set to *
File size: 1.6 KB
Line 
1#! /usr/bin/perl -w
2
3my $data;
4foreach my $file (@ARGV)
5{
6 if(open FILE,"<:raw",$file)
7 {
8 my $miss = 0;
9 my $missm = 0;
10 my $i = 1;
11 my $num = 0;
12 for(;;)
13 {
14 read FILE,$data,2;
15 my $len = unpack("n",$data);
16 last if $len == 65535;
17 if($len == 65534)
18 {
19 printf("%4d +++++\n", $i);
20 ++$num;
21 }
22 elsif($len)
23 {
24 ++$num;
25 read FILE,$data,$len;
26 $data =~ s/[\r\n]/./g;
27 printf("%4d %5d %.50s\n", $i, $len, $data);
28 }
29 else
30 {
31 printf("%4d -----\n", $i);
32 ++$miss;
33 }
34 ++$i;
35 }
36 my $mul = 0;
37 my $tot = 0;
38 my $max = 0;
39 my $comp = 0;
40 print "multi:\n";
41 $i = 1;
42 for(;;)
43 {
44 last if !read FILE,$data,1;
45 my $cnt = unpack("C",$data);
46 ++$mul if $cnt;
47 if($cnt == 0xFE)
48 {
49 ++$comp;
50 $tot += 2;
51 $cnt = 0;
52 printf("%4d +++++\n",$i);
53 }
54 else
55 {
56 if($cnt > $max)
57 {
58 $comp = 0;
59 $max = $cnt;
60 }
61 ++$comp if $cnt == $max;
62 $tot += $cnt;
63 printf("%4d -----\n",$i) if(!$cnt);
64 }
65 while($cnt--)
66 {
67 read FILE,$data,2;
68 my $len = unpack("n",$data);
69 if($len)
70 {
71 read FILE,$data,$len;
72 $data =~ s/[\r\n]/./g;
73 printf("%4d %5d %.50s\n", $i, $len, $data);
74 }
75 else
76 {
77 ++$missm;
78 }
79 }
80 ++$i;
81 }
82 close FILE;
83 printf("Status: Missing %d/%d - $num,$mul,$tot,$max,$comp\n",$miss,$missm);
84 }
85 else
86 {
87 print STDERR "Could not load language file $file.\n";
88 }
89}
Note: See TracBrowser for help on using the repository browser.