Menu

Multiple languages possible?

General
2012-05-21
2012-09-14
  • Heiko Irrgang

    Heiko Irrgang - 2012-05-21

    Hi,

    is there a way to document the source in multiple languages?

    Something like:

    English:

    Function: myFunction

    Some fancy function that does stuff

    German:

    Function: myFunction

    Krasse Funktion die sachen macht

     
  • Greg Valure

    Greg Valure - 2012-05-21

    You can document your code like this:

    // English Function: myFunction
    // Some fancy function that does stuff
    
    // German Function: myFunction
    // Krasse Funktion die sachen macht
    

    Then make two project folders and two output folders. In one project folder,
    edit Topics.txt to include this:

    Alter Topic Type: Function
    Keywords:
       English Function
    
    Alter Topic Type: Class
    Keywords:
       English Class
    

    and so on with anything you use. In the other one do the same thing but for
    German.

    What's happening is that you're using keywords Natural Docs would not normally
    understand so it ignores those comments by default. When running it with one
    output and project folder it will be configured to understand the English ones
    as well, and in the other output/project folder the German ones.

    The downside is that depending on the programming language you might not get
    prototypes for the first language. If the declaration for myFunction came
    immediately after the German comment it might not show up in the documentation
    for the English one. If you have basic language support the comments have to
    appear immediately before what they're documenting, and the English comment
    wouldn't.

     
  • Heiko Irrgang

    Heiko Irrgang - 2012-05-22

    Thanx, i think a 'proper' way to support multilanguage - like doxygen e.g. -
    would be some nice feature for the future

     

Log in to post a comment.