Translated man page scripts

Mario sent some scripts to maintain translated man pages.
This commit is almost the same scripts with minor adjustments.

Reference: http://www.freelists.org/post/procps/Translations-for-man-pages,17
This commit is contained in:
Craig Small 2014-05-28 19:51:37 +10:00
parent 23ebb9f44d
commit 4d31ff86ce
6 changed files with 13305 additions and 0 deletions

View File

@ -122,6 +122,12 @@ $(top_srcdir)/.version:
echo $(VERSION) > $@-t && mv $@-t $@
dist-hook:
echo $(VERSION) > $(distdir)/.tarball-version
./create-man-pot.sh
./translate-man.sh
get-trans:
echo "Getting the latest translations from translationproject.org..."
rsync -Lrtvz translationproject.org::tp/latest/procps-ng/ po
rsync -Lrtvz translationproject.org::tp/latest/procps-ng-man/ man-po
rsync -Lrtvz translationproject.org::tp/latest/procps-ng-man-ps/ man-po/ps
rsync -Lrtvz translationproject.org::tp/latest/procps-ng-man-top/ man-po/top

38
create-man-pot.sh Executable file
View File

@ -0,0 +1,38 @@
#!/bin/sh
#
# Run this command in the top level directory to create the translation template:
if [ -d man-po ] ; then
echo "man-po: directory exists, will be reused"
else
mkdir -p man-po
fi
po4a-updatepo -f man -m free.1 \
-m kill.1 \
-m pgrep.1 \
-m pidof.1 \
-m pkill.1 \
-m pmap.1 \
-m pwdx.1 \
-m skill.1 \
-m slabtop.1 \
-m snice.1 \
-m sysctl.8 \
-m sysctl.conf.5 \
-m tload.1 \
-m uptime.1 \
-m vmstat.8 \
-m w.1 \
-m watch.1 \
-p man-po/template-man.pot
po4a-updatepo -f man -m ps/ps.1 \
-p man-po/template-man-ps.pot
po4a-updatepo -f man -m top/top.1 \
-p man-po/template-man-top.pot
# Rename the file according to the version of your (pre-release) tarball.
# Send the new file together with a link to the tarball to the TP coordinators:
# <coordinator@translationproject.org>

5034
man-po/template-man-ps.pot Normal file

File diff suppressed because it is too large Load Diff

4595
man-po/template-man-top.pot Normal file

File diff suppressed because it is too large Load Diff

3583
man-po/template-man.pot Normal file

File diff suppressed because it is too large Load Diff

49
translate-man.sh Executable file
View File

@ -0,0 +1,49 @@
#!/bin/bash
#
# Run this script in the top level directory to create the translated man pages:
#
# Once the TP module has been created, this commands get the latest po files:
# echo "Getting the latest translations from translationproject.org..."
# rsync -Lrtvz translationproject.org::tp/latest/procps-ng-man/ man-po
# rsync -Lrtvz translationproject.org::tp/latest/procps-ng-man-ps/ man-po/ps
# rsync -Lrtvz translationproject.org::tp/latest/procps-ng-man-top/ man-po/top
if [ -d man-po ] ; then
echo "man-po: directory exists, will be reused"
else
mkdir -p man-po/{ps,top}
fi
cd man-po
langfiles=*.po
if [ $langfiles = '*.po' ] ; then
echo No man po files found
exit 0
fi
for lang in *.po
do
if [ -d ${lang%.*} ] ; then
echo "${lang%.*}: directory exists, will be reused"
else
mkdir -p ${lang%.*}/{man1,man5,man8}
fi
po4a-translate -f man -m ../free.1 -p ${lang} -l ${lang%.*}/man1/free.1
po4a-translate -f man -m ../kill.1 -p ${lang} -l ${lang%.*}/man1/kill.1
po4a-translate -f man -m ../pgrep.1 -p ${lang} -l ${lang%.*}/man1/pgrep.1
po4a-translate -f man -m ../pidof.1 -p ${lang} -l ${lang%.*}/man1/pidof.1
po4a-translate -f man -m ../pkill.1 -p ${lang} -l ${lang%.*}/man1/pkill.1
po4a-translate -f man -m ../pmap.1 -p ${lang} -l ${lang%.*}/man1/pmap.1
po4a-translate -f man -m ../pwdx.1 -p ${lang} -l ${lang%.*}/man1/pwdx.1
po4a-translate -f man -m ../skill.1 -p ${lang} -l ${lang%.*}/man1/skill.1
po4a-translate -f man -m ../slabtop.1 -p ${lang} -l ${lang%.*}/man1/slabtop.1
po4a-translate -f man -m ../sysctl.8 -p ${lang} -l ${lang%.*}/man8/sysctl.8
po4a-translate -f man -m ../sysctl.conf.5 -p ${lang} -l ${lang%.*}/man5/sysctl.conf.5
po4a-translate -f man -m ../tload.1 -p ${lang} -l ${lang%.*}/man1/tload.1
po4a-translate -f man -m ../uptime.1 -p ${lang} -l ${lang%.*}/man1/uptime.1
po4a-translate -f man -m ../vmstat.8 -p ${lang} -l ${lang%.*}/man8/vmstat.8
po4a-translate -f man -m ../w.1 -p ${lang} -l ${lang%.*}/man1/w.1
po4a-translate -f man -m ../watch.1 -p ${lang} -l ${lang%.*}/man1/watch.1
po4a-translate -f man -m ../ps/ps.1 -p ps/${lang} -l ${lang%.*}/man1/ps.1
po4a-translate -f man -m ../top/top.1 -p top/${lang} -l ${lang%.*}/man1/top.1
done