[Po4a-devel] Creation of pot files from LaTeX files

Carsten Gerlach daswaldhorn at gmx.de
Mon Sep 24 19:57:09 UTC 2012


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello po4a dev team,

I have a question about po4a-gettextize and I hope I’m right here on
the dev list with my normal user question. :-)

I’m a member of the Ubuntu Manual team [1] and we use po4a for
managing the translation of the manual. We use XeLaTeX for writing the
manual and so we have to deal with some tex commands in the
translation pot file.

Ok, I have a small example document to illustrate my question:

======minimal.tex=============================================
\documentclass{article}
\newcommand{\mycommand}{foo bar}
\begin{document}
\tableofcontents
\section{Hello World!}
\mycommand
\end{document}
==============================================================

If I now use po4a-gettextize to create a pot file

$ po4a-gettextize -f latex -m minimal.tex -p minimal.pot

I get the following output

======minimal.pot=============================================
[... header of pot file]

#. type: newcommand{#4}
#: minimal.tex:7
msgid "foo bar"
msgstr ""

#. type: section{#2}
#: minimal.tex:7
msgid "Hello World!"
msgstr ""

#. type: document
#: minimal.tex:7
msgid "\\mycommand"
msgstr ""
==============================================================

I see, that all known LaTeX commands are ignored by po4a (like
\tableofcontents) and only the real content which need a translation
is there.

So, how can I teach po4a with my own commands which should be ignored
by po4a (like \mycommand)?

I found the definition file of all latex commands
(/usr/share/perl5/Locale/Po4a/LaTeX.pm) and I had a look to the man
page of po4a-gettextize. But I do not see a possibility to give my own
definition file to the po4a run like something like that:

$ po4a-gettextize -f latex -m minimal.tex -p minimal.pot
- -use_my_file_with_ignored_commands

I would be glad if you can show me how to make this or point me to the
paragraph in the documentation which I did not yet find.

Thanks in advance!

Greetings, Carsten



[1] http://ubuntu-manual.org/


- -- 
Hier ist mein öffentlicher GPG-Schlüssel:
http://daswaldhorn.piranho.de/gpg/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iEYEARECAAYFAlBguxUACgkQ6SlDN6cxaI4xSQCfT+eJe8/X3++32GDDBK7p7J8r
qkcAnA30FAnRvlc9eN2NCJbAhlkJ1QnY
=KHl4
-----END PGP SIGNATURE-----



More information about the Po4a-devel mailing list