Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds full translation support to the website, with a simple language switcher in the toolbar. Most pages must be duplicated under _translations/ and then translated. There are also lines in _translations that have to be translated and some lines in _config.yml that have to be changed to add a language. Then Jekyll/Liquid's templating features will automatically update links to match the current page's language. All of this is handled at build time, with the exception of the 404 page which needed to be handled client-side due to Jekyll limitations. One of the big drawbacks of this approach is that building the website now takes dramatically longer (up to 2 minutes on my computer compared with the 4 seconds before this PR). However I think that this is still reasonable and is the best way to support translations without making much more dramatic changes. Unfortunately there is not really anything I can think to do to optimize this further given the limitations of Jekyll and Github Pages.
I also made various small changes along the way as I came across them. I know it's not very good progress but seeing spelling mistakes here and there I just couldn't resist 😳. I also modified some of the layouts and removed the
comments: true/false
from the front matter and just disabled comments across the entire site with the default values. I thought that we agreed previously to get rid of these since they are very difficult to moderate, but they were only ever disabled on certain pages until now.I've also included a partial French translation just to demonstrate how it works, although it is hidden unless its line in _config.yml under supported_languages is uncommented. I don't consider myself fluent in French, and I didn't put much effort into it, so it should not be added to the supported_languages list officially until someone more qualified reviews and finishes it.
I will write a full translation guide for potential contributors on a wiki page after these changes are merged.
Closes #16
The approach to translation support that I used was mostly based off of a blend of https://www.usecue.com/blog/multilingual-jekyll-websites/, the github source for that website, and https://www.kooslooijesteijn.net/blog/multilingual-website-with-jekyll-collections, with some personal touches 😉 .