Checks language availability for Chrome's built-in Translator API, running inside a Docker environment.
Generates a JSON file (out/results.json) with available translation languages grouped by source language, using the following format:
"en": [ "ar", "bg", "de", "de-AT", "es", "es-MX", "fr", "ja" ... ],Only language pairs with "downloadable" availability are included (Chrome can download the translation model according to the available documentation).
The idea was taken from this issue.
docker build -t language-validation .docker run --rm -v "$(pwd)/out:/out" language-validationdocker build --platform linux/amd64 -t language-validation .docker run --rm --platform linux/amd64 -v "$(pwd)/out:/out" language-validationOutput is saved to the out directory in the project.
├── Dockerfile # Docker image
├── run.js # Main script
├── blank.html # Minimal page to load the Translator API in Chrome
├── out/results.json # Output file with results
├── languages.json # Languages to check availability against the Translator API
└── README.md