Apertium Html-tools is a web application providing a fully localised interface for text/document/website translation, analysis, and generation powered by Apertium. Html-tools relies on an Apertium HTTP API such as Apertium-apy or ScaleMT (to a lesser extent). More information along with instructions for localization is available on the Apertium Wiki.
Configure the build by editing config.ts
.
Our sources are written in TypeScript.
Development requires installing Node.js and Yarn. After installing
both, use yarn install --dev
to install JavaScript packages. We use
ESLint & Stylelint for linting, Prettier for code formatting
and Jest as a test runner.
We use a variety of JS libraries at runtime:
To avoid distributing hundreds of JS files, we use esbuild to bundle sources into browser-ready JS.
First, follow the development instructions. Then, running yarn build
will
output built bundles to dist/
. Use --prod
to minify bundles. Any web server
capable of serving static assets can be pointed directly to dist/
.
Alternatively, if you'd like to avoid polluting your host system with build dependencies, use Docker:
docker build -t apertium-html-tools .
docker run --rm -v $(pwd)/dist:/root/dist apertium-html-tools
yarn build --watch
to keep dist/
up-to-date with new bundles.yarn serve
to run a simple Python server which serves dist/
on
localhost:8000
.yarn verify
to run the typechecker, linters and tests. See
package.json
for more granular scripts.To analyze the bundle size, run a prod build and upload the resulting
meta.json
file to Bundle Buddy.
We use GitHub Actions to run tests, linting, typechecking, etc. on each commit.