Provides functions that analyze and suggest translations for similar strings based on an existing translation. Powers the Smart Translations feature in Khan Translation Editor.
The Translation Assistant also auto-translates certain math notations, per specifications in this Google Sheet this document.
A backup of that document is kept in this repo in MathNotationByLanguage.tsv.
When a new team starts translations, they need to update the document
with their math notations, and the rules must be added
to MATH_RULES_LOCALES in src/math_translator.js.
The math auto-translation code is also utilized in the Khan Academy Dots browser plugin.
This repository is deployed to khan/frontend by referencing a specific Git commit
in khan/frontend/pnpm-workspace.yaml.
To test the frontend build, use:
APP_VERSION=local pnpm --filter devadmin build-appTo test the integration with the Translation Editor, use:
pnpm --filter devadmin test src/manticore-packageIf you update the math auto-translation functionality in src/math-translator.js,
you should also publish a new version of the Khan Academy Dots plugin,
which uses this repository as a Git submodule. Please follow the guidelines
in the repo README.
To run the tests:
npm run build && npm run testTo run the tests with test coverage, and report the results as text:
npm run build:coverage && npm run test:coverageTo ignore eslint style-guide commits in blame history, use:
git blame --ignore-revs-file .git-blame-ignore-revsor to do it automatically:
git config blame.ignoreRevsFile .git-blame-ignore-revs