Git Product home page Git Product logo

Comments (13)

nene avatar nene commented on August 25, 2024

Generally speaking, JSDuck has no support for i18n. So far one other person has asked about this topic, regarding translating ExtJS docs to Japanese. Currently this is far from being a priority for us, but localizing API documentation is a tricky problem. So if you have any ideas, please elaborate.

from jsduck.

atian25 avatar atian25 commented on August 25, 2024

I want to use jsduck to gen my plugin's doc, and it will be public to my team(with zh_CN) and share to ext forum (with en), so I write 2 language doc in the js file, but wan't to public only one language with a cmd param.

or can jsduck offer a param : filterTagList

sorry for my poor english.

from jsduck.

nene avatar nene commented on August 25, 2024

As I said earlier, there's currently no support for something like this in JSDuck.

What should the filterTagList parameter do?

from jsduck.

atian25 avatar atian25 commented on August 25, 2024

I write different lang descript with tags, such as @en some xxxx @zh_CN xxxx
then I can run jsduck 2 times with different 'filterTagList ' param and got 2 lang docs

from jsduck.

nene avatar nene commented on August 25, 2024

Hmmm... Do I understand correctly, that you would expect it to work like this:

/**
 * @en
 * Either shows or hides the component.
 * @param {Boolean} visible True to show, false to hide.
 *
 * @et
 * Näitab või peidab komponendi.
 * @param {Boolean} force True et näidata, false et peita.
 */
setVisibility: function(visible) {

And then one would run the jsduck with an option like --language=et or --language=en to get output in different languages?

from jsduck.

atian25 avatar atian25 commented on August 25, 2024

yes~
but as what you show... it sounds to ugly if had to write params docs many times... the source will be hard to read...
now I know that i18n is a real hard question.
thanks for reply.

from jsduck.

nene avatar nene commented on August 25, 2024

FYI: We might be having support for something like this coming. Something to conditionally turn a portion of doc-comment on or off. Not really for i18n purposes, but it could be used for that.

from jsduck.

AnnieCyl avatar AnnieCyl commented on August 25, 2024

@nene
hi. you said that you might be having support for something that conditionally turn a portion of doc-comment on or off. I wonder have you done that?

from jsduck.

nene avatar nene commented on August 25, 2024

Nope. That idea was not implemented.

from jsduck.

AnnieCyl avatar AnnieCyl commented on August 25, 2024

@nene
Are you going to implement?

from jsduck.

nene avatar nene commented on August 25, 2024

Unlikely.

from jsduck.

AnnieCyl avatar AnnieCyl commented on August 25, 2024

So that means there is no way to solve this problem using jsduck? we can't write annotations in different languages and then generate different documents?

from jsduck.

nene avatar nene commented on August 25, 2024

I suppose not.

I guess one could hack something in front of Markdown processor through which all the strings go. Export all the strings for translation. Translate them separately. Then map the original strings to translated versions. Kind'a similarly to the way how GNU Gettext works.

This all would be much easier though if in addition to JSON export, there would also be a proper JSON import, so one could take the exported JSON, translate that, and feed it back to JSDuck.

from jsduck.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.