r-cute / rcute-cozmars

Python SDK for Cozmars robot
32 stars 17 forks source link

Docs in English #20

Closed anjok closed 3 years ago

hyansuper commented 3 years ago

I searched and find two way to do translation

  1. Sphinx + gettext (https://www.sphinx-doc.org/en/master/usage/advanced/intl.html) This looks complicated, I don't fully understand. gettext works on sentence level, so I can use gettext for API docstring, but what if I want translate the whole page in docs/source/examples, and also , you don't need to directly translate every sentence, the purpose is for people understand how to use cozmars

  2. https://docs.readthedocs.io/en/stable/localization.html#project-with-multiple-translations This method sounds easier: I create a repo named rcute-cozmars-en, and you push your translation to this repo. then I put it on readthedocs.org and set it as a translation of my original documentation. According to this link, translation should be a different project, not a branch of the same project

anjok commented 3 years ago

The problem is that at the very least api docs and strings in .py files should be in English as it's otherwise almost impossible for every non Chinese to work with it.

But when you do that, the Chinese docs will be mixed with Chinese and English.

The .rst files are not that important as you can also browse the readthedocs in google translate. In fact this is what I used for doing this pull request.

But actually I would prefer having a bunch of demo code with comments in place of the written docs. That way you can run them directly without needing to copy out snippets.

hyansuper commented 3 years ago

The example rst files are more comprehensive and explanatory than API docs for beginner level programming education. That's the mindset I had when I wrote the docs. Advanced programmers should have little trouble with the api only by reading the function names,because this is not very technical like a framework lib. So I will not merge this PR until I figure out how to translate into English without deleting Chinese

anjok commented 3 years ago

No problem with not merging the rst. But will you merge the py files?

hyansuper commented 3 years ago

OK, the middle ground solution sounds reasonable. I am experimenting with a speaker, will you translate the py files of my new dev branch? then I will continue with dev before I merge it to master branch

anjok commented 3 years ago

Closed this and created a PR against dev.