diff options
author | Swedish Language Team <swedish> | 1999-10-24 23:56:11 +0000 |
---|---|---|
committer | Swedish Language Team <swedish> | 1999-10-24 23:56:11 +0000 |
commit | 0156d2d1de2089a5356c0c0d53d25aaef2544227 (patch) | |
tree | a641c8d0f2a8262660598155fa5155b6b887ea9a /check_trans.pl | |
parent | 7252ffe42d3adae5b9602040896c8474817619a8 (diff) |
Added a feature allowing listing of files to ignore when reporting missing
files, that can for example be used for old news items that the translators
do not intend to translate, and want to not get warned about.
Create a file called ".transignore" in the directory where the translations
would have resided, listing all files that are to be ignored.
CVS version numbers
check_trans.pl: 1.3 -> 1.4
Diffstat (limited to 'check_trans.pl')
-rwxr-xr-x | check_trans.pl | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/check_trans.pl b/check_trans.pl index 0670b428162..3f943e4f201 100755 --- a/check_trans.pl +++ b/check_trans.pl @@ -31,7 +31,7 @@ $opt_s = ''; $opt_p = undef; getopts('vds:p:'); -warn "Checking subtrre $opt_s only\n" if $opt_v; +warn "Checking subtree $opt_s only\n" if $opt_v; # include only files matching $filename $filename = $opt_p || '(\.wml$)|(\.html$)'; @@ -51,8 +51,9 @@ foreach (@en) { $tpath = $path; $tpath =~ s/^$from/$to/o; $d = load_entries($_); + $ignore = load_ignorelist($tpath); foreach $f (keys %$d) { - check_file("${tpath}$f", $d->{$f}); + check_file("${tpath}$f", $d->{$f}) unless $$ignore{"${tpath}$f"}; } } @@ -72,6 +73,19 @@ sub load_entries { return \%data; } +sub load_ignorelist { + my ($dir) = shift; + my (%data); + open(F, "${dir}.transignore") || return \%data; + warn "Loading ${dir}.transignore\n" if $opt_v; + while(<F>) { + chomp; + $data{"$dir$_"} = 1; + } + close (F); + return \%data; +} + sub check_file { my ($name, $revision) = @_; my ($oldr, $oldname); |