PiotrK
PiotrK

Reputation: 4453

Multiple languages in doxygen docs (C++)

My client gave me unusual (and non-negotiable) requirement to provide them with dual-language (English and Polish) doxygen documentation from C++ code.

My first idea is to use conditional compilation for comments, like:

#if DOXYGEN_ENGLISH
/**
 * @brief Sample method
 */
#elif DOXYGEN_POLISH
/**
 * @brief Przykładowa metoda
 */
#endif
void foo();

Then run Doxygen twice with different base locale and predefined constant... and it actually works. But it's very cumbersome...

Have someone has an idea how can I improve this solution? Or solve it different way?

Upvotes: 4

Views: 3674

Answers (1)

albert
albert

Reputation: 9047

Doxygen has the build in command \~[langId] for handling different languages. The above presented example could be formulated as:

/**
 * \~english @brief Sample method
 * \~polish @brief Przykladowa metoda
 */
void foo();
  • no direct requirement using a preprocessor / pre-processor directives / settings
  • only one place in the doxygen configuration file to be changed (Doxyfile) when switching language.

Upvotes: 8

Related Questions