[Debian-handbook-translators] Problem when build a localized version

Raphael Hertzog hertzog at debian.org
Tue May 6 13:37:54 UTC 2014


Hi,

On Sun, 04 May 2014, Claudio Filho wrote:
> I'm trying build a pdf for pt-BR version, but i couldn't find my error. I
> installed the required packages, but to pdf gives the error above, but runs
> fine to html.
> 
> RUN: dblatex -c dblatex/librement.conf  debian-handbook.xml
> Build the book set list...
> /home/filhocf/debian-handbook/tmp/pt-BR/xml/debian-handbook.xml:4:
> parser error : Attribute lang redefined
> <book lang="pt-BR" lang="pt-BR">
>                                ^
> unable to parse /home/filhocf/debian-handbook/tmp/pt-BR/xml/debian-handbook.xml

What version of publican are you using? It looks like Publican started to add
the required lang attributes by itself and the one added by build/build-pdf is
now an unwanted duplicate.

> Some tip?

Try this patch and let me know:

diff --git a/build/build-pdf b/build/build-pdf
index 1ec2e61..1421c0d 100755
--- a/build/build-pdf
+++ b/build/build-pdf
@@ -19,7 +19,9 @@ parse_options "$@"
 
 if [ ! -e tmp/$OPT_lang/xml ] || [ -z "$OPT_skip" ]; then
     publican build --config=publican-pdf.cfg --formats=xml --langs=$OPT_lang
-    sed -i -e "s/<book/<book lang=\"${OPT_lang}\"/" tmp/$OPT_lang/xml/debian-handbook.xml
+    if ! grep "<book " tmp/$OPT_lang/xml/debian-handbook.xml | grep -q "lang="; then
+       sed -i -e "s/<book/<book lang=\"${OPT_lang}\"/" tmp/$OPT_lang/xml/debian-handbook.xml
+    fi
 fi
 
 cp -a build/dblatex tmp/$OPT_lang/xml/

Cheers,
-- 
Raphaël Hertzog ◈ Debian Developer

Discover the Debian Administrator's Handbook:
→ http://debian-handbook.info/get/



More information about the Debian-handbook-translators mailing list