diff --git a/Makefile b/Makefile index 51d972f3a30ba3fc08c3333ef4c1ea9a0e2710e7..5eb482bb602579b396179a0a708cc683da2f9957 100644 --- a/Makefile +++ b/Makefile @@ -15,8 +15,8 @@ ifndef V endif endif -po4a.conf: scripts/create_po4a_conf.sh sources.txt $(LANGUAGE_PO) - @./scripts/create_po4a_conf.sh +po4a.conf: scripts/create_po4a_conf sources.txt $(LANGUAGE_PO) + @./scripts/create_po4a_conf po4a-stamp: po4a.conf $(EN_SOURCES) $(LANGUAGE_PO) Makefile $(QUIET_PO4A)PERL5LIB=./po4a/lib po4a/po4a -v po4a.conf diff --git a/scripts/create_po4a_conf b/scripts/create_po4a_conf new file mode 100755 index 0000000000000000000000000000000000000000..fa982feebaeb362b441fe571744e2db53a693172 --- /dev/null +++ b/scripts/create_po4a_conf @@ -0,0 +1,17 @@ +#!/usr/bin/env python3 +import glob + +with open('po4a.conf', 'w') as f: + f.write('[po4a_langs]') + langs = [ l[17:-3] for l in glob.glob('po/documentation.*.po')] + langs.sort() + f.write(' '.join(langs)) + f.write('\n[po4a_paths] po/documentation.pot $lang:po/documentation.$lang.po\n[options] opt: " -k 80"\n') + with open('sources.txt', 'r') as sources: + for source in sources: + source = source.strip() + f.write(f"[type: asciidoc] en/{source} $lang:./$lang/{source}") + if source.startswith('git'): + f.write(' add_$lang:?addenda/addendum.$lang.txt\n') + else: + f.write('\n') diff --git a/scripts/create_po4a_conf.sh b/scripts/create_po4a_conf.sh deleted file mode 100755 index ff10936acd09fc6a472dce7ccc823dc9c4bc60d4..0000000000000000000000000000000000000000 --- a/scripts/create_po4a_conf.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash - -echo -n "[po4a_langs]" >po4a.conf -langs=$(for l in po/documentation.*.po -do - rstripped=${l%%.po} - echo -n " ${rstripped##po/documentation.}" -done) -echo $langs >> po4a.conf - -cat <<EOF >>po4a.conf -[po4a_paths] po/documentation.pot \$lang:po/documentation.\$lang.po -[options] opt: " -k 80" - -EOF - -for f in $(cat sources.txt) -do - echo -n "[type: asciidoc] en/$f \$lang:./\$lang/$f" >> po4a.conf - if [ ${f:0:3} = git ] - then - echo " add_\$lang:?addenda/addendum.\$lang.txt" >> po4a.conf - else - echo >> po4a.conf - fi -done