3 . `dirname $0`/../config.sh
5 gettextfiles=$(find cgi-bin lib -not -name 'LanguageNames.pm' -a -not -name 'Sections.pm' -a \( -name '*.pl' -o -name '*.pm' \));
6 gettextfiles="$gettextfiles bin/create_index_pages"
7 podomains="pdo sections langs"
11 # Common options for all calls
12 xgettext_opts="--language=Perl --keyword=_ --keyword=N_ --keyword=_g --foreign-user --add-comments"
14 echo gettextfiles=$gettextfiles
15 xgettext $xgettext_opts -d pdo -o ${podir}/pdo.pot ${gettextfiles}
16 xgettext $xgettext_opts -d sections -o ${podir}/sections.pot ${libdir}/Packages/Sections.pm
17 xgettext $xgettext_opts -d langs -o ${podir}/langs.pot ${libdir}/Packages/I18N/LanguageNames.pm
21 # normalize paths in .pot files
22 for domain in ${podomains}
24 perl -p -i -e "s,^#:\s*\Q${topdir}\E,#: .,go" ${domain}.pot
27 # Create missing po files
29 for lang in ${polangs}
31 for domain in ${podomains}
33 test -f ${domain}.${lang}.po || cp ${domain}.pot ${domain}.${lang}.po
39 for lang in ${polangs}
41 for domain in ${podomains}
43 mv ${domain}.${lang}.po ${domain}.${lang}.po.tmp
44 msgmerge -q -F -o ${domain}.${lang}.po ${domain}.${lang}.po.tmp ${domain}.pot
45 rm ${domain}.${lang}.po.tmp
46 # normalize paths in .po files
47 perl -p -i -e "s,^#:\s*\Q${topdir}\E,#: .,go" ${domain}.${lang}.po
53 test -d ${localedir} || mkdir -p ${localedir}
54 for lang in ${polangs}
56 test -d ${localedir}/${lang}/LC_MESSAGES \
57 || mkdir -p ${localedir}/${lang}/LC_MESSAGES
58 for domain in ${podomains}
60 echo domain=$domain language=$lang
61 msgfmt --statistics -o ${localedir}/${lang}/LC_MESSAGES/${domain}.mo ${domain}.${lang}.po