]> git.ipfire.org Git - thirdparty/squid.git/blame - scripts/verify_errorpages.pl
SourceFormat Enforcement
[thirdparty/squid.git] / scripts / verify_errorpages.pl
CommitLineData
cb4114f5 1#!/usr/bin/perl
a151895d 2#
4ac4a490 3## Copyright (C) 1996-2017 The Squid Software Foundation and contributors
a151895d
AJ
4##
5## Squid software is distributed under GPLv2+ license and includes
6## contributions from numerous individuals and organizations.
7## Please see the COPYING and CONTRIBUTORS files for details.
8##
cb4114f5 9
10open(LIST,"<list") || die;
11while (<LIST>) {
12 chomp;
13 push (@pages, $_);
14}
15close LIST;
16
17foreach $page (@pages) {
18 open(IN, "<English/$page") || die;
19 $file = join("", <IN>);
20 close(IN);
21 $file =~ s/%(.)/$english{$page}{$1}++, "%$1"/ge;
22}
23
24foreach $lang (@ARGV) {
25 foreach $page (@pages) {
26 undef %codes;
27 open(IN, "<$lang/$page") || die;
28 $file = join("", <IN>);
29 close(IN);
30 $file =~ s/%(.)/$codes{$1}++/ge;
31 foreach $code (keys %codes, keys %{$english{$page}}) {
32 if ($codes{$code} ne $english{$page}{$code}) {
33 print("$lang/$page %$code mismatch (found $codes{$code}, expected $english{$page}{$code})\n");
34 }
35 }
36 }
37}