Re: Polyglot alternative to Doxygen and Robodoc?
On Tue, Feb 08, 2005 at 11:25:21AM -0200, Jeronimo Pellegrini wrote:
> On Mon, Feb 07, 2005 at 08:48:51PM -0500, Michael Marsh wrote:
> > On Mon, 7 Feb 2005 13:35:44 -0200, Jeronimo Pellegrini
> > <pellegrini@mpcnet.com.br> wrote:
> > > Yes, but if I understand it correctly, that is only for the Doxygen text...
> > > How do I tell Doxygen where the documentation is in English and where it is
> > > in Portuguese?
> > > Or some other way to make it understand documentation in several languages
> > > (the format doesn't matter).
> >
> > You should be able to use "\if" (or "@if") and define appropriate
> > sections. Then with two config files you can specify an "English"
> > section and a "Portugese" section, only one of which is included in
> > each config.
>
> Ah, I see what you mean. Many thanks! I tried, and it worked fine.
And since someone requested off-list that I posted the details to this thread,
here is what I did:
In the code, I used \english, \endenglish, \portugues and \endportugues:
/**
\portugues
Decide se um programa pára ou não.
Esta função decide se um programa vai em algum momento parar.
@param p O programa
@param a Os argumentos para o programa
@return Um booleano: true se o programa para, ou false se nunca para.
\endportugues
\english
Decides if a program ever halts.
This function decides if a program will ever halt.
@param p The program
@param a The arguments to the program
@return A boolean: true if the program ever halts, and false
otherwise
\endenglish
*/
bool halts (Program p, void *a) { ... }
Then I created one Doxygen config file for each language.
In one of them, I had:
ENABLED_SECTIONS = english
In the other,
ENABLED_SECTIONS = portugues
And in both,
ALIASES = "english=\if english" \
"endenglish=\endif" \
"portugues=\if portugues" \
"endportugues=\endif"
Then I just had to use Doxygen with each config file (Doxyfile.pt, Doxyfile.en) to
generate the documentation in both languages.
J.
Reply to: