~ubuntu-branches/debian/squeeze/sympa/squeeze

« back to all changes in this revision

Viewing changes to src/etc/script/find_missing_messages.pl

  • Committer: Bazaar Package Importer
  • Author(s): Christian Perrier
  • Date: 2007-01-20 18:09:28 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20070120180928-0e42mbwg87mlo44y
Tags: 5.2.3-1.2
* Non-maintainer upload to re-fix l10n issues
* As debconf-updatepo was not run in previous versions, the French
  translation was outdated. Hence fix it.
* Remove several duplicate spaces in the debconf templates

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/perl
 
2
# find_missing_messages.pl
 
3
# This script finds error and notice messages missing from wwsympa.fcgi, and outputs them 
 
4
# in a form similar to these files so you can simply copy-paste it. Don't forget to set the dir variable!
 
5
# Author: Gábor Hargitai <higany@sch.bme.hu.>
 
6
 
 
7
use strict;
 
8
my $dir="./sympa-5.0b.1";
 
9
 
 
10
open(wwsympa,"<$dir/wwsympa/wwsympa.fcgi");
 
11
open(error,"<$dir/web_tt2/error.tt2");
 
12
my %errors;
 
13
while (<wwsympa>) {
 
14
        if (/.*\&error_message\(\'(\w*)\'(.*)\);/) {
 
15
                $errors{$1}=$2;
 
16
        }
 
17
}
 
18
while (<error>) {
 
19
        if (/.*error\.msg[ =]*\'(\w*)\'.*/) {
 
20
                if (defined($errors{$1})) {
 
21
                        delete $errors{$1};
 
22
                }
 
23
        }
 
24
}
 
25
print "Missing error messages:\n\n\n";
 
26
my ($name, $param);
 
27
while (($name,$param) = each(%errors)) {
 
28
#       printf "%15s%s\n",$name,$param;
 
29
        print "[% ELSIF error.msg == '$name' %]\n";
 
30
        print "[%|loc";
 
31
        if ($param ne "") {
 
32
                $param =~ /.*,.*\{\'(\w*)\'.*=>.*/;
 
33
                print "(error.$1)";
 
34
        }
 
35
        print "%]*****************[%END%]\n\n";
 
36
}
 
37
 
 
38
seek wwsympa, 0, 0;
 
39
open(notice,"<$dir/web_tt2/notice.tt2");
 
40
my %notices;
 
41
while (<wwsympa>) {
 
42
        if (/.*\&message\(\'(\w*)\'(.*)\);/) {
 
43
                $notices{$1}=$2;
 
44
        }
 
45
}
 
46
while (<notice>) {
 
47
        if (/.*notice\.msg[ =]*\'(\w*)\'.*/) {
 
48
                if (defined($notices{$1})) {
 
49
                        delete $notices{$1};
 
50
                }
 
51
        }
 
52
}
 
53
print "\n\n\n\nMissing notice messages:\n\n\n";
 
54
my ($name, $param);
 
55
while (($name,$param) = each(%notices)) {
 
56
#       printf "%15s%s\n",$name,$param;
 
57
        print "[% ELSIF notice.msg == '$name' %]\n";
 
58
        print "[%|loc";
 
59
        if ($param ne "") {
 
60
                $param =~ /.*,.*\{\'(\w*)\'.*=>.*/;
 
61
                print "(notice.$1)";
 
62
 
 
63
        }
 
64
        print "%]*****************[%END%]\n\n";
 
65
}
 
66