#!/bin/sh # # Add translations for $po_filters for every .pot file in this tree, and if # we find what looks like autoconf scripts setting ALL_LINGUAS, add the # new translations to the list of languages. # po_filters="biffster chef drawl jive krad kraut l33t redneck valspeak" quiet=false exec < /dev/null for arg in $@ ; do case "$arg" in --quiet) quiet=true ;; *) po_filters="$po_filters $arg" ;; esac done for filter in $po_filters ; do fakelang="en_US@$filter" found=false for potfile in `find . -name "*.pot"` ; do if test -r "$potfile" ; then subdir=`dirname $potfile` if ! $quiet ; then echo "Generating $fakelang translation." fi pomatic $potfile $filter > $subdir/$fakelang.po found=true fi done if ! $found ; then continue fi for script in `find . -name configure.in -o -name configure.ac -o -name configure` ; do if test -r $script ; then sed -e 's,^ALL_LINGUAS="\(.*\)",ALL_LINGUAS="\1 '"$fakelang"'",g' $script > $script.___spec_prep_post && \ chmod --reference $script $script.___spec_prep_post && \ touch -r $script $script.___spec_prep_post && \ mv -f $script.___spec_prep_post $script && \ $quiet || echo "Added $fakelang to ALL_LINGUAS in $script." if test -r $script.__spec_prep_post ; then rm -f $script.___spec_prep_post fi fi done done