diff options
author | Denis Barbier <barbier> | 2002-02-21 08:51:18 +0000 |
---|---|---|
committer | Denis Barbier <barbier> | 2002-02-21 08:51:18 +0000 |
commit | 2403f278abbdfdbe176cb81c75d6a53fa9c23641 (patch) | |
tree | 50a7588d3387d852e7ee467bd088dab6ae743a68 /Perl/Webwml | |
parent | 653af3dffc830bb2a464c32bf449457f53a5989a (diff) |
Minor changes when checking templates
CVS version numbers
Perl/Webwml/L10n/Debconf.pm: 1.6 -> 1.7
Diffstat (limited to 'Perl/Webwml')
-rw-r--r-- | Perl/Webwml/L10n/Debconf.pm | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/Perl/Webwml/L10n/Debconf.pm b/Perl/Webwml/L10n/Debconf.pm index 606336b872c..62524859899 100644 --- a/Perl/Webwml/L10n/Debconf.pm +++ b/Perl/Webwml/L10n/Debconf.pm @@ -66,18 +66,15 @@ sub _init { =item read_compact -Read a template containing all translations. When optional second -parameter is non-zero, a warning is displayed if translated fields are -found; this is useful to check for master templates file. +Read a template containing all translations. - $tmpl->read_compact($file, 1); + $tmpl->read_compact($file); =cut sub read_compact { my $self = shift; my $file = shift; - my $master = shift || 0; my ($lang, $msg); $self->_init(); @@ -86,19 +83,20 @@ sub read_compact { my $tmpl = ''; my $line = 0; + my $once = 1; while (<TMPL>) { chomp; $line ++; - if ($master && m/^[A-Z][a-z]*-[A-Za-z_]+(-fuzzy)?:/) { - warn "$file:$line: translated-fields-in-master-templates\n"; - # Display this message only once - $master = 0; - goto SKIP; - } if (m/^[A-Z][a-z]*-[A-Za-z_]+-fuzzy:/) { warn "$file:$line: fuzzy-fields-in-templates\n"; goto SKIP; } + if ($once && m/^[A-Z][a-z]*-[A-Za-z_]+:/) { + warn "$file:$line: translated-fields-in-master-templates\n"; + # Display this message only once + $once = 0; + goto SKIP; + } if (s/^Template:\s*//) { $tmpl = $_; $self->{orig}->{$tmpl} = {}; |