Add Finnish translation of user guide with language switcher#509
Add Finnish translation of user guide with language switcher#509moritz-gross wants to merge 1 commit intodaisy:mainfrom
Conversation
Implements multi-language docs support (issue daisy#504). Adds a language switcher to the layout header, a Finnish translation of users.md (ported from samimaattaCelia's repo), and local Jekyll dev tooling (Gemfile, README, .gitignore entries).
|
The docs get moved to github.io via settings/pages: That's about the extent of my knowledge. AI says we should create That seems reasonable. Note: I think users should have a choice of languages, so I asked AI to add that (part of above). It also said that we can override the default by adding a GitHub action:
To pickup the languages automatically, more changes are needed (according to Gemini):Since you’re already using Jekyll (as indicated by the MathCAT pull request you are viewing), you can automate the language switcher entirely using Liquid. This means you won't have to update a JavaScript list every time you add a new translation. Here is how to set up an automated switcher that detects your folders and keeps the user on their current page when they switch:
YAML
HTML
To fix this gracefully, you can add a small check to the script: The "Safe" Approach: If you want to be 100% safe, have the switcher always link to the homepage of that language (e.g., /fi/) as we discussed previously. The "Smart" Approach: Use the script above, but add a 404.html page to your repo that detects if the user just tried to switch languages and offers to take them to the English version if the translation is missing. Summary of the Workflow
|

I prototyped internationalization of the docs for Finnish. The English version still lives directly in
docs, but we now also support other langues in subfolders likefi,de, etc.@samimaattaCelia below is your translation running in the same template that's already in use, except that I added a language switcher to it. Is this what you have in mind?
Also, I don't know what you technically mean by "considering different screen readers". Can't we just have one
user.mdfile that has different sections for this?@NSoiffer I ran jekyll using a mounted Docker container. How did you do local development? I haven't found a gemfile and also some entries could be added to the
.gitignore.Generally, how does hosting the docs work? afaik, there is not GitHub Actions workflow. does it rely on the repo settings and a hardcoded path (so
docsI guess?)As we already have some translations, I wanted to get this started quickly so that you are not blocked.
let me know which parts of this prototype can stay or have to be changed. I haven't worked with Jekyll yet, so I'm very much improvising here.