Skip to content

I18n Proposition

coder114514 edited this page Mar 19, 2025 · 2 revisions

Translator

The i18n folder under this repo contains the code for the translator.

Github Action

For each language, there will be a prompt and a dictionary file. These files together with the English XMLs will be fed into the translator, which outputs translated XMLs that will be stored into a branch called translated_xmls under this repo (using peaceiris/actions-gh-pages@v4).

When the repo is deployed, besides generating docs_out for the original XMLs, the translated XMLs will be pulled from translated_xmls and will run through the scripts for generating docs_out.

The whole process of the proposed github action:

  1. Check whether there are changes of the prompts, the dictionaries or the English XMLs. (using dorny/path-filters@v3)
  2. When changes exist, the translator will be triggered to translate the English XMLs into other languages and store the output in translated_xmls.
  3. Run the generating scripts on the English XMLs.
  4. Pull translated_xmls, and run the generating scripts for each language.
  5. Deploy docs_out to https://sicp.sourceacademy.org

The Front End

In the frontend repo, there will be a selection menu for the language, which will control what json is fetched.

New Language Addition

When a new language is requested, a prompt and a dictionary file need to be provided, which will be merged into this repo through pull request to generate the translated version of sicp.

Clone this wiki locally