Neil Williams: po4a and translating manpages
po4a creates the meta files needed to generate the manpages but the actual generation process is a little awkward and tends to become heavily customised.For emdebian-rootfs, I've now received the Portuguese translation and I've been improving the
genmanpages script. It's now more general and easier to configure for different source packages. There remain a few hidden assumptions which I hope to fix in future.
#!/bin/sh
set -e
# Copyright (C) 2006-2009 Neil Williams
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
# name and location of the config file
# relative to the top level source directory of the translations
# i.e. the directory containing ./po/
CONFIG="doc/po4a.config"
# POTFILE path
POTFILE="po/emdebian-rootfs.pot"
# the binary packages that will contain generated manpages
BINARIES="emdebian-rootfs multistrap"
# the binary packages with manpages in Section 3.
HASMAN3="emdebian-rootfs"
# the binary packages using DocBook XML & xsltproc
XMLPACKAGES="emdebian-rootfs"
# the DocBook XML files (TODO: let this take paths)
XMLFILE="emdebian-rootfs.1.xml"
# the XSL file to use for Docbook XSL
XSLFILE="http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl"
# the POD files (TODO: let this take paths)
PODFILE="em_multistrap"
# the binary packages using POD
PODPACKAGES="multistrap"
# remember to add something to the clean:: rule in debian/rules
# to remove each binary package sub-directory.
# $(RM) -r doc/emdebian-rootfs doc/multistrap
# below this point, no changes should be needed.
wrap_langs ()
if [ -z "$LANGS" ]; then
echo "$1 $2" >> $CONFIG
else
echo "$1 $2 $3" >> $CONFIG
fi
if [ -f po4a.config ]; then
cd ../
fi
if [ -f ../po4a.config ]; then
cd ../../
fi
# calculate the langs, automatically.
LANGS= ls po/*.po 2>/dev/null true
if [ ! -z "$LANGS" ]; then
LANGS= ls po/*.po sed -e 's/.*\/\(.*\)\.po/\1 /' true
fi
if [ ! -z "$LANGS" ]; then
# LANGS should not include the specification, just the root.
LANGS= echo $LANGS sed -e 's/_.*//'
LANGS= echo $LANGS sed -e 's/@.*//'
LANGS= echo $LANGS sed -e 's/\+.*//'
echo "[po4a_langs] $LANGS" > $CONFIG
else
echo > $CONFIG
fi
wrap_langs "[po4a_paths]" "$POTFILE" "\$lang:po/\$lang.po"
for d in $BINARIES; do
for l in $LANGS; do
mkdir -p doc/$d/man/$l/man1/
if [ "$d" = "$HASMAN3" ]; then
mkdir -p doc/$d/man/$l/man3/
fi
done
mkdir -p doc/$d/man/man1/
if [ "$d" = "$HASMAN3" ]; then
mkdir -p doc/$d/man/man3/
fi
mkdir -p doc/pod/$l/
done
mkdir -p doc/html/
for file in ls doc/xml/*.xml ; do
xmllint --format "$file" --output "$file"
LOCAL= basename $file
wrap_langs "[type:docbook]" "$file" "\$lang:doc/xml/\$lang/$LOCAL"
done
# oops, this needs to be configurable
for file in em_multistrap; do
wrap_langs "[type: pod]" "$file" "\$lang:doc/pod/\$lang/$file"
done
# use -k to create all XML even if untranslated or the XSL breaks the build.
po4a -k 0 $CONFIG
for d in $BINARIES; do
for P in $XMLPACKAGES; do
for X in $XMLFILE; do
XML_CATALOG_FILES="/etc/xml/catalog" \
xsltproc -o doc/man/ --nonet $XSLFILE doc/xml/$X
done
if [ "$d" = "$HASMAN3" ]; then
mv doc/man/*.3 doc/$P/man/man3/
fi
mv doc/man/*.1 doc/$P/man/man1/
done
for POD in $PODPACKAGES; do
pod2man $PODFILE > doc/$POD/man/man1/$PODFILE.1
done
for l in $LANGS; do
for P in $XMLPACKAGES; do
for X in $XMLFILE; do
XML_CATALOG_FILES="/etc/xml/catalog" \
xsltproc -o doc/man/ --nonet $XSLFILE doc/xml/$l/$X
done
if [ "$d" = "$HASMAN3" ]; then
mv doc/man/*.3 doc/$P/man/$l/man3/
fi
mv doc/man/*.1 doc/$P/man/$l/man1/
done
for POD in $PODPACKAGES; do
pod2man doc/pod/$l/$PODFILE > doc/$POD/man/$l/man1/$PODFILE.1
done
done
done
for l in $LANGS; do
rm -rf doc/xml/$l
done
rm -rf doc/pod/
# the rest is specific to emdebian-rootfs - ignore.
# HTML versions, not packaged.
xsltproc -o doc/html/ --nonet \
http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl \
doc/xml/emdebian-rootfs.1.xml
for i in ls doc/html/*.html ; do
iconv -t utf-8 -f iso8859-1 $i > doc/html/tmp
sed < doc/html/tmp > $i -e 's:charset=ISO-8859-1:charset=UTF-8:'
done
rm -f doc/html/tmp
OK, more to be done here but it has a basic idea. The generated files are separated out into directories determined by the binary package name into which the manpages will be installed.
This gives a .install line something like:
doc/emdebian-rootfs/man/* ./usr/share/man/This is important because it reduces the number of changes needed to add a new translation - in effect, only the $lang.po file itself.
It should at least give some ideas of what can be done.

After long deliberation (a good few months!), I today came to the decision that I no longer felt that I could be part of the Ubuntu IRC Team.
I have felt for a long time that the Ubuntu IRC team has become an elitist crowd, with a very cliquey inner circle, and those who are not in the inner circle being treated on multiple levels like second class citizens.
There are a lot of things that have pushed me to make this decision, and I ve not made it lightly. I ve voiced my concerns to the IRC Council previously, (via individual emails), and had no response. I don t see the situation getting any better. In fact, more and more, I see it getting worse.
I know that I m not the only person who s thinking this way, though I may be one of the only ones that feels that I need to lay down my cinnamon roll. I ve discussed these issues on multiple occassions with various members of the community (both in and out of the team), and with people linked to the Ubuntu IRC community in one way or another (Debian Developers, Freenode Staff, etc etc).
There are also other people who ve come out of the woodwork after I posted
Something that has been annoying me recently with my bank has been that their website tells me that they will never ask for my password over the phone. And then their call centre asks me for my password. Over the phone. Of course the call centre doesn't mean my website password - they mean the special 'ultra-secure 5ekr1t code phrase', but they don't have a good, universally understood word to use for that. Hopefully they'll work one out, but they appear to have
About four months ago I described how 
A bit more than a week after Debconf9 ended here is a post summarising what I remember about it for myself to look back to later, for others that were there for a good memory, for those that were not there for insight and for organisers of future Debconfs to improve.
Let s start with something most people know I took photos, a lot of photos. The main photo naturally was the
This question keeps on popping up in many recent newspaper articles, on discussion boards and in seminars debating immigration issues in Finland. At the core of the question is a general impression that, between the enthusiastic supporters of multiculturalism and the pessimistic nationalist rednecks, very little constructive discussion is possible in Finland.
At one end, humanitarian help organizations, as well as politicians from the Green Party and the Swedish Folk Party, keep on taking excessively generous initiatives towards refugees and asylum seekers, all while labeling their detractors as racists. At the other end, nationalist candidates in the National Coalition Party and True Finns Party keep on painting every immigrant as a refugee who is abusing social security and label their detractors as turning Finland into the easiest country to abuse social security, at the Finnish taxpayer's expense. In between, candidates from the Christian Democrats and Center Party spread equally among these two camps. Meanwhile, while the Left is currently avoiding discussions on this topic, Social Democrats have previously shown that they tend to side with the nationalists in labeling all immigrants as social security abusing refugees.
One interesting point is that, no matter at which end of the political spectrum one looks, the whole Finnish immigration debate keeps on focusing exclusively on refugees and asylum seekers, despite the fact that migrant workers and foreign spouses of Finnish nationals make up for a good 70% of the foreign population residing on Finnish soil.
This recalcitrance to discuss immigration from any other perspective than refugees is rather painfully noticeable. Some recent examples:
Today I went to the La Merced area to finally buy a foldable bike. There were basically four options:
It is also a heavy bike (I have not weighed it yet, but comparative guesstimates puts it over the Alubikes), so it might be problematic when travelling... I'll see when in Nicaragua in a couple of weeks ;-) I have yet a couple of adjustments to make to it, but I am very looking forward to travelling with my bike on. I hope it turns out to be comfortable.
And in any case, I can of course! donate it to my nephews... who are in the right age group.
Some photos: