-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multi Language Support #59
Comments
Hello @pmarsceill , I use just-the-docs for documentation. Let me ask you a question. |
Using https://github.com/untra/polyglot, I was able to at least internationalize the site content. But the theme for sure needs i18n baked in, cause things like the title or the footer content or even the search is either impossible or very difficult to internationalize. |
@pmarsceill Can you please let us know when is "Next release that will include multi-lingual support" planned? |
Since this is one of the most-requested features, I'm going to pin this at the top of our issues page.
For context: a couple of maintainers have been partially onboarded recently, and I am currently doing the bulk of the triaging work; between myself and @pdmosses, we are split on implementing new features. As such, if anybody is willing to take point on this issue, that would be much appreciated. I agree that internationalization will require a huge undertaking and likely some significant refactoring. Also going to place requests for internationalized search in this issue for now. Happy to create a separate (fresh) issue, but it seems like it is a related (if not completely synonymous) topic. |
FYI In #128 there's also mention of using the Multiple Languages Jekyll plugin. |
Hello all. I had to scratch my head a bit today in order to figure out how make the nav menus change based on the selected language (using the above-mentioned Multiple Languages Plugin). If you're interested, I've outlined my path and the solution I came to in this discussion. |
I'd like to share a workaround I've tested that works. To have a multi language doc site, I built two just the doc sites separately and assigned each with a subpath. For example in the two _config.yml EN site:
Other language site:
And at the top of the markdown files insert
With a py script to change some paths before building the site with jekyll, this language switching can work both when viewing the docs on github and in the built just the doc site. Because these are just two sites, I can use different image or video assets demoing the project with different frontend languages. The build action I used is here (it's a bit complicated because I'm putting the doc folder inside the project instead of a separate repo, but essentially just jekyll build repeated twice), doc markdown in github repo is under this folder |
What about supporting the projects which uses suffix/prefix in file's name for separate language specific pages? What I mean: |
Hello! Thank you for the wonderful Jekyll theme. But, unfortunately, search in non-Latin languages does not work. |
Hi @Aharito, thanks for the comment. As of now, no progress has been made - both with broad multi-language support and the narrow case for search. For the latter, we are relying on lunr.js, which hasn't been updated in about 3 years. However, my understanding is that the lunr-languages project might support your use-case; I haven't used it specifically with JtD, so would be curious to see what your experience is! |
Everything turned out to be very simple. I chose the simplest method to install the theme in my repo - through “Use this template”. That is, I did all the actions directly on this GitHub repo, without creating a local copy. To connect the necessary lunr languages, I didn’t bother and also chose the simplest method. Namely: I created an I created a subfolder
Next, I created the {% if site.search_enabled != false %}
<script type="text/javascript" src="{{ '/assets/js/vendor/lunr.min.js' | absolute_url }}"></script>
<script type="text/javascript" src="{{ '/assets/js/vendor/lunr.multi.min.js' | absolute_url }}"></script>
<script type="text/javascript" src="{{ '/assets/js/vendor/lunr.stemmer.support.min.js' | absolute_url }}"></script>
<script type="text/javascript" src="{{ '/assets/js/vendor/lunr.ru.min.js' | absolute_url }}"></script>
{% endif %} Then I added my P.S. If someone needs another language, instead of the |
Hi @mattxwang By the same method as above, it is easy to move the inclusion of multi-language search to If search_languages is an list, then include corresponding lines and files to theme. |
I'm glad it worked well @Aharito, and I appreciate you enumerating these steps. If you're willing, it'd be great if you could document this upstream (so others can learn how to do it too). I'm happy to work with you (reviewing the PR, etc.) to get this done. |
It would be great if we could manage multiple languages for our documentation
There should be a sticky language "switcher" button on the header.
And we could write the pages under
docs/<language>/...
Btw, thanks for this beautiful site! I just love it and I am planning on using for my projects
The text was updated successfully, but these errors were encountered: