]> git.ipfire.org Git - thirdparty/squid.git/blob - scripts/update-pot.sh
Upgrade comm layer Connection handling
[thirdparty/squid.git] / scripts / update-pot.sh
1 #!/bin/sh
2 #
3 # Update the core errpages.pot file from the basic templates
4 # Useful if any template has altered.
5 #
6 # To be run during maintenance from the main squid directory
7 #
8
9 ## Begin errors/ Updates.
10
11 cd errors/
12 # Make sure any existing temp stuff is gone from previous updates...
13 rm -rf ./pot
14 rm -f errpages.pot.new
15 rm errpages.pot
16
17 # make a temp directory for all our workings...
18 mkdir pot
19
20 # Generate per-page dictionaries ...
21 for f in `ls -1 ./templates/`; do
22 case ${f} in
23 error-details.txt)
24 ../scripts/mk-error-details-po.pl ./templates/${f} > ./pot/${f}.pot
25 ;;
26 ERR_*)
27 html2po -i ./templates/${f} -P --duplicates=merge -o ./pot/${f}.pot
28 ;;
29 *)
30 echo "SKIP: ${f}"
31 esac
32 done
33
34 # merge and sort the per-page .pot into a single master
35 msgcat ./pot/*.pot -s -o errpages.pot.new &&
36 (
37 cat errpages.pot.new |
38 sed s/PACKAGE\ VERSION/Squid-3/ |
39 sed s/LANGUAGE\ \<LL\@li\.org\>/Squid\ Developers\ \<squid-dev\@squid-cache\.org\>/
40 ) >errpages.pot
41
42 ## Update all existing dictionaries with the new content ...
43 for f in `ls -1 ./*.po` ; do
44 echo -n "Update: ${f} ... "
45 msgmerge --verbose -s -o ${f}.new ${f} errpages.pot
46 chown --reference=${f} ${f}.new
47 mv ${f}.new ${f}
48 done
49
50 # cleanup.
51 rm -rf pot
52 rm -f errpages.pot.new
53 cd ..
54 ## Done errors/ Updates
55
56
57 ## begin doc/manuals updates
58
59 # Build the po4a.conf
60 cat doc/po4a.cnf >po4a.conf
61 for f in `ls -1 helpers/*/*/*.8 src/*.8.in tools/*.1 tools/*.8.in` ; do
62 echo "" >>po4a.conf
63 manp=`basename ${f}`
64 echo "[type: man] ${f} \$lang:doc/manuals/\$lang/${manp}" >>po4a.conf
65 done
66
67 ## po4a conversion of all doc/manuals man files...
68 po4a --no-translations -o groff_code=verbatim --verbose po4a.conf
69
70 (
71 cat doc/manuals/manuals.pot |
72 sed s/PACKAGE\ VERSION/Squid-3/ |
73 sed s/LANGUAGE\ \<LL\@li\.org\>/Squid\ Developers\ \<squid-dev\@squid-cache\.org\>/
74 ) >doc/manuals/manuals.pot.tmp
75 mv doc/manuals/manuals.pot.tmp doc/manuals/manuals.pot
76
77 ## Done doc/manuals/ Update