7 my $srcdir = $ENV{'srcdir'} || '';
8 $srcdir .= '/' if $srcdir;
10 open I
, "<$srcdir../src/mainfrm.cc" or die $!;
12 m!(\w+)->Append[A-Za-z]*\(.*\(/\*.*?\*/(\d+)! && push @
{$menu{$1}}, $2;
16 #for (sort keys %menu) { print "$_:".join("|", @{$menu{$_}})."\n" }
19 for my $lang (@ARGV) {
20 $lang =~ s/\.msg$//; # allow en or en.msg
21 my $hdr = "Lang $lang:\n";
22 # .msg files could be in srcdir or build directory when building outside
24 open L
, "<$srcdir$lang.msg" or open L
, "<$lang.msg" or die $!;
29 my @msg = split /\0/, $buf;
30 for my $menu (sort keys %menu) {
34 for (@
{$menu{$menu}}) {
36 my ($item) = (split(/\\t/, $m))[0];
37 my ($acc) = ($item =~ /\&([\x00-\x7f]|[\xc2-\xdf].|[\xe0-\xef]..|[\xf0-\xf4]...)/);
39 print "Lang $lang : message $_ '$m' has no shortcut\n";
43 if (exists $sc{$acc}) {
48 print "Menu $menu : '$msg[$sc{$acc}]' and '$m' both use shortcut '$acc'\n";
55 # Tally available letters
56 while ($item =~ /([A-Za-z]|[\xc2-\xdf].|[\xe0-\xef]..|[\xf0-\xf4]...)/g) {
63 print "Unused letters: ", grep {!exists $sc{$_}} (sort keys %let), "\n";
64 print "Not-present ASCII letters: ", grep {!exists $let{$_}} ('a' .. 'z'), "\n";
68 print "\n" unless defined $hdr;