Help us reach even more students by translating Mathigon into other languages.
All of Mathigon's content is stored in this GitHub repository. The text, including translations, are written in Markdown, a special way of annotating HTML. We use a slightly different custom syntax, and you can have a look at one of our existing courses like Circles and Pi.
Every course lives in a different folder under content/. To translate a course, you have to create a copy of the
content.md file in that folder, add the appropriate extension (e.g.
content_de.md), and place it in the
translations/ folder for that course. You have to do the same for any
.yaml files in the folder (e.g
hints.yaml), as well as the YAML fiels in the shared/ directory (e.g.
Next, replace all the English text with the corresponding translation (but not any IDs, class names or embedded HTML code). Of course, you can start with just some sections, rather than the entire course at once.
When adding a new language for the first time, you also have to add it to the Gulpfile, to ensure it is parsed correctly. If you're familiar with GitHub and NodeJS, you can follow these instructions to run a local webserver and test your changes. Otherwise, you can also just email the translations as a text file to firstname.lastname@example.org.
It is possible to generate automated translations using Google Translate, while preserving all built-in tags, markup and syntax. Simply edit the constants at the beginning of utilities/translate.js, including a link to a Google Cloud Service Account for the Translate API) and then run
The auto-generated files will need to be reviewed manually, paying particular attention to these common issues:
glossary.yamlare not translated by default.