Re: Transifex and the manual files

Marco Ciampa <[email protected]>
Newsgroups gmane.comp.gnome.apps.mc.devel
Message-ID <20150610223049.GA2056@ciampix-A532>
On Mon, Jun 08, 2015 at 10:18:48PM +0200, Yury V. Zaytsev wrote:
[...]
> I don't think you'd need to mess with autostuff though. As a first
> approximation, I suppose the output could be two shell scripts:
> 
> - one would take the "reference" (English) man page template (man.x.in),
> and convert it to a pot-file using the po4a tool with correct settings
> - another one would take the translated po-file, and convert it back
> into a man.x.in file, which would be suitable to generate the help files

See attached files:

make-update-po.sh

make-i10n.sh

these are pretty self-explanatory. The first create/update the .po file from
the reference man doc. After first run you should set a couple of thing to
actually enable doc creation. You have to set the .po doc encoding (UTF-8),
the language, the translator name and email address and un-fuzzy the headers.
The second get the main doc (man page) the .po translator file and merge into
the translated man page.
Put these two scripts in doc/man dir & make those executable.
Please save the old translation man pages for reference (I did a 
cp it/mc.1.in it/mc.1.in.save
for example)

Use po4a version 0.45 or newer.

Regards,

--


Marco Ciampa

I know a joke about UDP, but you might not get it.

+------------------------+
| GNU/Linux User  #78271 |
| FSFE fellow       #364 |
+------------------------+

_______________________________________________
mc-devel mailing list
https://mail.gnome.org/mailman/listinfo/mc-devel
make-i10n.sh (application/x-sh, 585 B)
#!/bin/bash

if [ "$1" = "" ]; then
  echo "Usage: $0 [-n] AA BB CC DD ..."
  echo " where AA BB are language codes as 'it fr'"
  echo " option -n print command instead of exec it."
fi

if [ "$1" = "-n" ]; then
  DEBUG=1
  shift
fi

for i in $@
do
  #check if i18n dir exist
  if [ -d $i ]; then
    if [ "$DEBUG" = "1" ]; then
      #Debug mode, just print
      echo "po4a-updatepo -f man -v -M utf-8 -m mc.1.in -p ${i}/mc.1.in.po"
    else
      po4a-updatepo -f man -v -M utf-8 -m mc.1.in -p ${i}/mc.1.in.po
    fi
  else
    echo "Warning: i18n dir '$i' does not exist!"
  fi
done
make-update-po.sh (application/x-sh, 759 B)
#!/bin/bash


if [ "$1" = "" ]; then
  echo "Usage: $0 [-n] AA BB CC DD ..."
  echo " where AA BB are language codes as 'it fr'"
  echo " option -n print command instead of exec it."
fi

if [ "$1" = "-n" ]; then
  DEBUG=1
  shift
fi

for i in $@
do
  #check if i18n dir exist
  if [ -d $i ]; then
    if [ "$DEBUG" = "1" ]; then
      #Debug mode, just print
      echo "po4a-translate -f man -A utf-8 -M utf-8 -m mc.1.in -p ${i}/mc.1.in.po -k 0 -l ${i}/mc.1.in"
    else
      #po4a-translate -f man -a ${i}/addendum -A utf-8 -M utf-8 -m mc.1.in -p ${i}/mc.1.in.po -k 0 -l ${i}/mc.1.mc 
      po4a-translate -f man -A utf-8 -M utf-8 -m mc.1.in -p ${i}/mc.1.in.po -k 0 -l ${i}/mc.1.in 
    fi
  else
    echo "Warning: i18n dir '$i' does not exist!"
  fi
done
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.