Paste #7DMCx9TqQH8VKM0HLyTs

build/xubuntu-docs/desktop-guide/Makefile [2015-03-15 07:30:04.668614244 +0100]
branches/xubuntu-docs/desktop-guide/Makefile [2015-03-11 15:37:34.479876000 +0100]
11 11 TRANSLATIONS=$(shell cat po/LINGUAS)
12 12 else
13 13 OPTS=
14 TRANSLATIONS=$(shell basename -s .po -a po/*.po)
14 TRANSLATIONS=$(shell basename -s .po -a po/*po)
15 15 endif
16 16
17 17 html: style
18 @printf "<itemizedlist>\n\t<listitem><para>Attributed on each language's page.</para></listitem>\n</itemizedlist>\n" > C/translators.xml
19 xsltproc --xinclude -o ../build/C/index.html $(XUBUNTUXSL) C/index.xml
18 @echo "<para>Attributed on each language's page.</para>" > C/translators.xml
19 xsltproc --xinclude -o ../build/desktop-guide/index.html $(XUBUNTUXSL) C/index.xml
20 20
21 21 epub: epubstyle
22 @printf "<itemizedlist>\n\t<listitem><para>Attributed on each language's page.</para></listitem>\n</itemizedlist>\n" > C/translators.xml
23 xsltproc --xinclude -o ../build/C/ /usr/share/xml/docbook/stylesheet/nwalsh/epub3/chunk.xsl C/index.xml
24 cd ../build/C; \
22 @echo "<para>Attributed on each language's page.</para>" > C/translators.xml
23 xsltproc --xinclude -o ../build/desktop-guide/ /usr/share/xml/docbook/stylesheet/nwalsh/epub3/chunk.xsl C/index.xml
24 cd ../build/desktop-guide/; \
25 25 zip -0Xq xubuntu-docs.epub mimetype;\
26 26 zip -Xr9Dq xubuntu-docs.epub *
27 27
28 28 style:
29 29 mkdir -p ../build/libs
30 cp -r libs/*.css ../build/libs/
31 cp -r libs/images ../build/libs/
32 cp -r libs/admon ../build/libs/
33 cp -r libs/navig ../build/libs/
30 cp -r libs/*css ../build/libs
31 cp -r libs/images ../build/libs
32 cp -r libs/admon ../build/libs
33 cp -r libs/navig ../build/libs
34 34
35 35 epubstyle:
36 mkdir -p ../build/C/libs/images
36 mkdir -p ../build/desktop-guide/libs/images
37 37 cp -r libs/images/preferences-desktop.png \
38 38 libs/images/system-lock-screen.png \
39 39 libs/images/system-log-out.png \
41 41 libs/images/package_icon.png \
42 42 libs/images/menu_icon.png \
43 43 libs/images/key_icon.png \
44 ../build/C/libs/images/
44 ../build/desktop-guide/libs/images/
45 45
46 46 translate:
47 47 ../scripts/translate.sh $(OPTS); \
48 ../scripts/translators.sh $(OPTS); \
49 48 for dir in $(TRANSLATIONS); do \
49 ../scripts/translators.sh -l $$dir > $$dir/translators.xml ;\
50 50 xsltproc --xinclude -o ../build/$$dir/index.html $(XUBUNTUXSL) $$dir/index.xml ;\
51 51 done
52 52
build/xubuntu-docs/scripts/translators.sh [2015-03-15 09:17:56.000000000 +0100]
branches/xubuntu-docs/scripts/translators.sh [2015-03-11 15:37:34.479876000 +0100]
1 1 #!/bin/sh
2 2
3 get_languages () {
4 if [ "$generated" = "yes" ];then
3 CURDIR=$(pwd)/po/
4
5 get_languages() {
6 if [ "$generated" = yes ];then
5 7 languages=$(cat po/LINGUAS)
6 elif [ -n "$language" ];then
8 elif [ -n $language ];then
7 9 languages=$language
8 else
9 languages=$(basename -s .po -a po/*.po)
10 fi
10 else
11 languages=$(basename -s.po $CURDIR/*.po)
12 fi
11 13 }
12 14
13 build_creds () {
14 for lang in $languages;do
15 translators=$(sed -n '/^msgid "translator-credits"/,/^$/ {s@^"[ ]*\(.\+\)[ ]\+https://launchpad.net/~\([^ \\]\+\).*$@\t<listitem><para>\1 (\2)</para></listitem>@p;/^$/Q}' po/$lang.po | sort -u)
16 if [ -z "$translators" ];then
17 translators='\t<listitem><para>Translator data could not be acquired, please see <ulink url="https://translations.launchpad.net/xubuntu-docs">Launchpad</ulink>.</para></listitem>'
18 fi
19 printf "<itemizedlist>\n%b\n</itemizedlist>\n" "$translators" > $lang/translators.xml
20 done
15 build_creds() {
16 #for lang in `basename -s.po *.po`;do ## Good for testing, uses all translations it can find.
17 echo "<itemizedlist>"
18 for lang in $languages;do
19 mkdir -p $CURDIR/mo/$lang/LC_MESSAGES/
20 msgfmt -o $CURDIR/mo/$lang/LC_MESSAGES/xubuntu-docs.mo $CURDIR/$lang.po
21 translators=$(TEXTDOMAINDIR=$CURDIR/mo/ LANGUAGE=$lang gettext -d xubuntu-docs -s 'translator-credits' | \
22 sed -e 's@^ @\t<listitem><para>@' -e '/launchpad.net/s@$@)</para></listitem>@' \
23 -e 's@https://launchpad.net/~@(@' -e /Launchpad\ Contributions/d -e /^translator-credits$/d | sort -u)
24 done
25 if [ "$translators" = "" ];then
26 echo "<listitem><para>Unable to parse translator data or data unavailable, see <ulink url=\"https://translations.launchpad.net/xubuntu-docs/\">Launchpad</ulink></para></listitem>"
27 else
28 echo "$translators"
29 fi
30 echo "</itemizedlist>"
31 rm -rf $CURDIR/mo/
21 32 }
22 33
23 build_creds_alt () {
24 for lang in $languages;do
25 mkdir -p po/mo/$lang/LC_MESSAGES
26 msgfmt -o po/mo/$lang/LC_MESSAGES/xubuntu-docs.mo po/$lang.po
27 translators=$(TEXTDOMAINDIR=po/mo LANGUAGE=$lang gettext -d xubuntu-docs -s 'translator-credits' | \
28 sed -n 's@^[ ]*\(.\+\)[ ]\+https://launchpad.net/~\([^ ]\+\).*$@\t<listitem><para>\1 (\2)</para></listitem>@p' | sort -u)
29 if [ -z "$translators" ];then
30 translators='\t<listitem><para>Translator data could not be acquired, please see <ulink url="https://translations.launchpad.net/xubuntu-docs">Launchpad</ulink>.</para></listitem>'
31 fi
32 printf "<itemizedlist>\n%b\n</itemizedlist>\n" "$translators" > $lang/translators.xml
33 done
34 rm -rf po/mo
34 grep_creds() {
35 ## Don't build, just grep.
36 ## This is incomplete and unused, potentially helpful later.
37 for lang in $languages;do
38 echo msggrep --msgid -F -e 'translator-credits' $lang.po
39 done
35 40 }
36 41
37 while getopts ":gl:" opt;do
38 case $opt in
39 g) generated="yes";;
40 l) language=$OPTARG;;
42 while getopts ":gl:" Option
43 do
44 case ${Option} in
45 g) generated=yes;;
46 l) language=${OPTARG};;
47 *) echo "Please specify an argument.";;
41 48 esac
42 49 done
43 50