Closed blurHY closed 5 years ago
@rllola Ah, was looking for this in the material documentation, thanks!
Actually, it doesnt seems to be the best way of doing according to the creator :
MkDocs doesn't support language toggling/branching, so Material cannot add this functionality either. To solve this, you would need to build two separate versions of your docs, one for each language configuring the correct search language in mkdocs.yml. By customizing the theme you could link to the other language inside the header or where you want, effectively switching between the two separate builds.
https://github.com/squidfunk/mkdocs-material/issues/867
Might be better to create 2 differents documentation as suggested ? I am starting on the french translation. And will see if I cannot configure the nav field to redirect to the french.
It is also mentioned here : https://www.mkdocs.org/user-guide/configuration/#lang
Interesting, OK. I'd recommend holding back on the ZeroFrame API docs as I'm currently overhauling them.
Ok, cool. I played a little with the template. We just need to find the best place to show the link for the different languages.
An advantage with doing one documentation for each is that the search engine won't show all the results in all the language and getting smaller page (so faster to show).
However we need to find the best structures for it and write some scripts for easy update.
That doesn't sound too bad. Perhaps a little translation icon to the right of the Github stats in the header which one can click for a dropdown of all available languages?
How will the folder structure of the repo change (if at all)?
I was thinking of something like this ? Each language has its own folder but the bitcoinbar
element might need to be moved...
├── docs
│ ├── docs.css
│ ├── docs.js
│ ├── en
│ │ ├── bitcoinbar
│ │ │ ├── bitcoinbar.css
│ │ │ ├── bitcoinbar.js
│ │ │ └── demo.html
│ │ ├── faq.md
│ │ ├── help_zeronet
│ │ │ ├── coding_conventions.md
│ │ │ ├── contributing.md
│ │ │ ├── donate.md
│ │ │ └── network_protocol.md
│ │ ├── index.md
│ │ ├── site_development
│ │ │ ├── cert_authority.md
│ │ │ ├── content_json.md
│ │ │ ├── dbschema_json.md
│ │ │ ├── getting_started.md
│ │ │ └── zeroframe_api_reference.md
│ │ └── using_zeronet
│ │ ├── create_new_site.md
│ │ ├── installing.md
│ │ └── sample_sites.md
│ ├── fr/ (french doc)
│ ├── img/
│ ├── jquery.min.js
│ └── logo/
├── example/
├── LICENSE
├── mkdocs.yml
├── README.md
├── start.py
├── start.sh
└── theme/
EDIT: And +1 for the translation icon in the header.
Yes, ideally we wouldn't copy anything besides the *.md
files. Alright, this seems like enough to start a preliminary PR with. Do you want to take the lead on that?
We still need someone to design the button with the dropdown menu, I might refer to @HelloZeroNet on that one as he's better at design that I?
Yes sure.
For the dropdown menu we can just use the design from the material theme. Maybe it can redirect also to an actual page with link to help on translation, etc...
I have a couple of ideas. I can play around and post the result here ?
I was thinking a dropdown menu from the button, but perhaps the last item could have a divider line with a link to a page about translating? Like Translation HowTo
?
Sounds good :+1:
First draft
This can be closed. Multi-language is now supported for the documentation.
mkdocs-material seems to support localization : https://squidfunk.github.io/mkdocs-material/getting-started/#localization