[debian-edu-commits] [Git][debian-edu/debian-edu-doc][master] 2 commits: Add to get_manual the capability of filtering out untranslatable strings
Frans Spiesschaert
gitlab at salsa.debian.org
Sun Aug 16 19:50:03 BST 2020
Frans Spiesschaert pushed to branch master at Debian Edu / debian-edu-doc
Commits:
1b522afc by Frans Spiesschaert at 2020-08-16T20:44:43+02:00
Add to get_manual the capability of filtering out untranslatable strings
- - - - -
e20d1be3 by Frans Spiesschaert at 2020-08-16T20:49:34+02:00
Adapt the respective po4a.cfgs to the new capability of filtering out untranslated strings
- - - - -
6 changed files:
- documentation/audacity/po4a.cfg
- documentation/debian-edu-bullseye/po4a.cfg
- documentation/debian-edu-buster/po4a.cfg
- documentation/debian-edu-itil/po4a.cfg
- documentation/rosegarden/po4a.cfg
- documentation/scripts/get_manual
Changes:
=====================================
documentation/audacity/po4a.cfg
=====================================
@@ -1,6 +1,7 @@
[po_directory] .
[type: docbook] audacity-manual.xml \
+ pot_in:audacity-manual-stripped.xml \
$lang:$lang.xml \
add_$lang:?./$lang.add \
- opt:"-M UTF-8 -k 15"
+ opt:"-o nodefault='<inlinemediaobject>' -o untranslated='<inlinemediaobject>' -M UTF-8 -k 15"
=====================================
documentation/debian-edu-bullseye/po4a.cfg
=====================================
@@ -1,6 +1,7 @@
[po_directory] .
[type: docbook] debian-edu-bullseye-manual.xml \
+ pot_in:debian-edu-bullseye-manual-stripped.xml \
$lang:$lang.xml \
add_$lang:?./$lang.add \
- opt:"-o nodefault='<inlinemediaobject> <imagedata>' -o untranslated='<listitem> <inlinemediaobject> <imagedata>' -M UTF-8 -k 15"
+ opt:"-o nodefault='<inlinemediaobject>' -o untranslated='<inlinemediaobject>' -M UTF-8 -k 15"
=====================================
documentation/debian-edu-buster/po4a.cfg
=====================================
@@ -1,6 +1,7 @@
[po_directory] .
[type: docbook] debian-edu-buster-manual.xml \
+ pot_in:debian-edu-buster-manual-stripped.xml \
$lang:$lang.xml \
add_$lang:?./$lang.add \
- opt:"-o nodefault='<inlinemediaobject> <imagedata>' -o untranslated='<listitem> <inlinemediaobject> <imagedata>' -M UTF-8 -k 15"
+ opt:"-o nodefault='<inlinemediaobject>' -o untranslated='<inlinemediaobject>' -M UTF-8 -k 15"
=====================================
documentation/debian-edu-itil/po4a.cfg
=====================================
@@ -1,6 +1,7 @@
[po_directory] .
[type: docbook] debian-edu-itil-manual.xml \
+ pot_in:debian-edu-itil-manual-stripped.xml \
$lang:$lang.xml \
add_$lang:?./$lang.add \
- opt:"-o nodefault='<inlinemediaobject> <imagedata>' -o untranslated='<listitem> <inlinemediaobject> <imagedata>' -M UTF-8 -k 15"
+ opt:"-o nodefault='<inlinemediaobject>' -o untranslated='<inlinemediaobject>' -M UTF-8 -k 15"
=====================================
documentation/rosegarden/po4a.cfg
=====================================
@@ -1,6 +1,7 @@
[po_directory] .
[type: docbook] rosegarden-manual.xml \
+ pot_in:rosegarden-manual-stripped.xml \
$lang:$lang.xml \
add_$lang:?./$lang.add \
- opt:"-M UTF-8 -k 15"
+ opt:"-o nodefault='<inlinemediaobject>' -o untranslated='<inlinemediaobject>' -M UTF-8 -k 15"
=====================================
documentation/scripts/get_manual
=====================================
@@ -8,8 +8,8 @@
# Author/Copyright: Holger Levsen
# Licence: GPL2+
# first edited: 2006-07-06
-# last edited: 2020-02-23
-#
+# last edited: 2020-08-16
+#
# 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 2 of the License, or
@@ -39,7 +39,7 @@ if [ ! $(which GET) ] ; then
exit_loud_and_clearly "Please install libwww-perl."
fi
-if [ "$name" = "" ] ; then
+if [ "$name" = "" ] ; then
exit_loud_and_clearly "error: missing \$name variable, not exported from Makefile?"
fi
URL=https://wiki.debian.org
@@ -273,3 +273,27 @@ if [ "$(grep -v FIXMEs $xmlfile |grep FIXME |grep -v 'status ignore'|uniq)" != "
echo "====================" >> $TMPFILE
fi
mv $TMPFILE fixme-status.txt
+
+######
+###### remove some untranslatable strings from $xmlfile
+######
+
+# create $stripped_xmlfile which will have some non-translatable strings
+# removed and will be used for POT and PO file creation via po4a.
+stripped_xmlfile=$name-stripped.xml
+
+ # --remove untranslatable image names
+ sed -e 's#<imagedata.*</imageobject>#</imageobject>#g' $xmlfile > $stripped_xmlfile
+
+ # --remove paragraphs that just have a <ulink> and no other text
+ #---first copy those paragraphs to a tempfile,
+ TMPFILE3=$(mktemp)
+ cat $xmlfile | sed -n '/^<para><ulink/p' | sed -n '/> *$/p' > $TMPFILE3
+ #---and then replace those links with an empty string
+ #---but keep the <para> tag to prevent xml from being broken
+ while read line ;
+ do sed -i "s#$line#<para>#" $stripped_xmlfile
+ done < $TMPFILE3
+
+ # --remove FIXME: paragraphs
+ sed -i '/^FIXME:/d' $stripped_xmlfile
View it on GitLab: https://salsa.debian.org/debian-edu/debian-edu-doc/-/compare/f9ab0d47a6f6215e51b2d1ed02d0bce3e55be9ce...e20d1be3924a83ed6694ec3b74bb06117ba0351e
--
View it on GitLab: https://salsa.debian.org/debian-edu/debian-edu-doc/-/compare/f9ab0d47a6f6215e51b2d1ed02d0bce3e55be9ce...e20d1be3924a83ed6694ec3b74bb06117ba0351e
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-edu-commits/attachments/20200816/27c1e573/attachment-0001.html>
More information about the debian-edu-commits
mailing list