Bug#564915: more research
On Thu, Feb 11, 2010 at 05:56:08PM +0100, Holger Levsen wrote:
> will reply to some of your questions in the previous mail as well as attach
> the patch at another time, am busy with other stuff atm... just a quick
> comment:
no problem :)
> Great results. Just what I dont understand is the spanish translation gained
> two translated strings?!!?
Old: debian-edu-lenny-manual.es.po: 235 translated messages, 215 fuzzy translations, 661 untranslated messages.
New: debian-edu-lenny-manual.es.po: 233 translated messages, 219 fuzzy translations, 659 untranslated messages.
If you look at the "translated messages" (translation exists and is correct),
there are -2 translations, so this should be ok, they are in fuzzy now.
The decrease in "untranslated messages" (translation is empty) is probably due to 2 msgids that could be fitted by a msgstr, although fuzzy.
I modified the patch slightly (remove extra empty line), it's attached (no
change in final results).
Cheers,
Andi
Index: get_images
===================================================================
--- get_images (revision 62612)
+++ get_images (working copy)
@@ -41,12 +41,12 @@
}
sub replace () {
- open(FILE, "< $file") or die "Can't open $file perhaps not in the correct dir?";
+ open(FILE, "< $file") or die "Can't open $file perhaps not in the correct dir? Error: $!";
undef $/;
my $local = <FILE>;
close(FILE);
# look for images...
- if ( $local =~ "m#<imagedata fileref='/".$path."/\w+\?action=AttachFile&do=get&target=([^']+)'/>#" ) {
+ if ( $local =~ "m#<imagedata fileref='/".$path."/\\w+\?action=AttachFile&do=get&target=([^']+)'/>#" ) {
# ..and replace the paths
$local =~ s#<imagedata fileref='([^'"<>]+)'/>#create($1)#eg;
open(FILE, "> $file") or die "Can't open $file for writing";
Index: get_manual
===================================================================
--- get_manual (revision 62612)
+++ get_manual (working copy)
@@ -36,7 +36,7 @@
# the last but one sed "preserves" the 2nd matched regex
# the last sed does the same as dos2unix
# head at the end chops of the last two lines with the Category:Permalink entry
-GET "${url}AllInOne?action=raw"|sed "s%<<Include(%%g" | sed "s%)>>%%g" | sed "s%$path1%%g" |sed 's/.$//'|head -n -2> id
+GET -H User-Agent: "${url}AllInOne?action=raw"|sed "s%<<Include(%%g" | sed "s%)>>%%g" | sed "s%$path1%%g" |sed 's/.$//'|head -n -2> id
for i in `cat id` ; do
TARGET=`echo "${i}" |sed "s/\(.*\)\/\(.*\)/\2/" `.xml
@@ -61,10 +61,12 @@
sed "s#</articleinfo>##g" |
sed "s#</revision>##g" |
sed "s%<para><ulink url='http://wiki.debian.org/CategoryPermalink#'>CategoryPermalink</ulink> </para>%%" |
- sed "s%<\/%\n<\/%g" |
sed "s%<title>%\n<title>%g" |
+ sed "s%<\/title>%\n<\/title>%g" |
sed "s%<section>%\n\n<section>%g" |
+ sed "s%<\/section>%\n<\/section>%g" |
sed "s%<para>%\n<para>%g" |
+ sed "s%<\/para>%\n<\/para>%g" |
sed "s%</date>\(.*\)\$%%g" |
sed "s%FIXME%\nFIXME%g" |
sed '1,4d' > $TARGET
@@ -102,10 +104,9 @@
perl -0\777 -pi -e "s/<ulink url='$path2(.*)\/(.*)'>(.*)\n<\/ulink>/<link linkend=\"\2\">\3<\/link>/g" $xmlfile
# make it a docbook article again
-sed -i "1,/</ s#<#<?xml version=\"1.0\" encoding=\"UTF-8\"?><!DOCTYPE article PUBLIC \"-//OASIS//DTD DocBook XML V4.4//EN\" \"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd\"><article><articleinfo><title>$DEBIAN_EDU_DOC_TITLE</title></articleinfo>\n<#" $xmlfile
+sed -i "0,/</ s#<#<?xml version=\"1.0\" encoding=\"UTF-8\"?><!DOCTYPE article PUBLIC \"-//OASIS//DTD DocBook XML V4.4//EN\" \"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd\"><article><articleinfo><title>$DEBIAN_EDU_DOC_TITLE</title></articleinfo>\n<#" $xmlfile
sed -i "$ s#>#>\n</article>#" $xmlfile
-# remove the first two empty lines
-sed -i "1,2d" $xmlfile
+
# clean it further
TMPFILE2=$(mktemp)
xmllint $xmlfile > $TMPFILE2
Reply to: