apertium / apertium-html-tools

Web application providing a fully localised interface for text/website/document translation, analysis and generation powered by Apertium.
http://wiki.apertium.org/wiki/Apertium-html-tools
GNU General Public License v3.0
39 stars 90 forks source link
apertium-tools machine-translation natural-language single-page-app web-app

Apertium Html-tools

Build
Status Coverage Status

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.

Configuration

Configure the build by editing config.ts.

Dependencies

Development

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.

Runtime

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.

Building

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

Contributing

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.