transLATER

in testing MIT PythonDockerOllamaGitLabHugo

Repository

This page was translated automatically from Italian. Read the original

Write now, translate LATER.

transLATER: Write now, translate LATER. Project documentation translated by itself, including drawings

A service that translates your GitLab project documentation by itself, using a language model that runs at your home: no external services, no costs per word. Write in your language, push, and a few minutes later the translations are in the repository. The name plays on the English word later: you write now, the translation arrives a little later.

It translates:

The translations end up next to the originals, in the same repository:

OriginalTranslation
README.mdREADME.en.md
docs/img/schema.svgdocs/img/schema.en.svg
content/guide/x/index.md (Hugo)content/guide/x/index.en.md
frontend.ymlfrontend.en.yml
i18n/it.tomli18n/en.toml
.env.example, conf.yaml (comments).env.en.example, conf.en.yaml

At the top of every Markdown, including the original, there is the available languages bar: 🌐 **Italiano** · [English](https://git.eandgcode.com/egprojects/translater/-/blob/main/README.en.md). It is written by checking which files actually exist, so an added language appears on its own; in translations, links to other documents and images point to their translations.

GitLab ──push──► webhook ──► transLATER (queue, one run at a time) ──► commit «Automatic translations»
                                   │
                                   └──► translater-ollama (language model on GPU)

Requirements

While working, the model takes up almost the entire graphics card and a few GB of RAM; after 5 minutes of inactivity, it unloads itself, and between one run and the next, only the two programs remain (about a hundred MB). If another program is using the graphics card, the model relies more on the processor: slower, but it works.

Installation

  1. The GitLab user (see below): a normal user, Maintainer of the projects to be translated, and their token.
  2. On the PC, in this folder: ./setup-translater.sh. On the first run, it creates .env from the .env.en.example model: fill in the server details (SERVER_SSH, SERVER_KEY), GITLAB_URL and GITLAB_TOKEN, then run it again. The script copies itself to the server, builds the image, starts the two containers, and downloads the model (once). It can also be run directly on the server: in that case, the SERVER_* lines remain empty.
  3. In every project to be translated, a translations.yml. On the next run, the service finds it, creates the project webhook, and translates everything; then it starts again on every push.

The status page is at http://IP-DEL-SERVER:8790/ (user translater, password in .env on the server: STATO_PASSWORD): queue, latest runs, PNG previews of translated drawings, «Write now, translate LATER» button.

The GitLab user

transLATER commits carry that user’s «noreply» address, and the webhook recognizes them: a translation commit does not trigger another run.

The model

By default gemma4:26b-a4b (Google Gemma 4, experts: 26 billion parameters, 4 active at a time), chosen through a competition on the same texts: sections with lists, a paragraph with code, a page’s front matter, the 36 labels of an SVG diagram, and a few difficult sentences.

ModelSpeed (RTX 4070 12 GB + Xeon 22 core)How it went
gemma4:26b-a4b (18.7 GB)43 token/sexcellent: glossary respected, bold text and code intact, in the drawing it moves words between broken lines so they remain readable
qwen3.6:35b-a3b (22.6 GB)48 token/sgood, but it also translates inside the code (sensors/<stanza>/… → <room>) and applies the glossary incorrectly
gemma4:31b (dense, 20.4 GB)9 token/slike the 26b, five times slower, and it also touches the code
translategemma:12b6.5 token/s (CPU only)good but without context: «si toglie tensione» → «we are relieving stress»
translategemma:27b5.3 token/sno better than the 12b

It changes with --model <nome> (any Ollama model): the cache is per model, so with a new model everything is retranslated. On smaller machines gemma4:12b (8 GB) or gemma4:e4b (6.6 GB) are lighter; their quality has not been tested.

How it translates

When it runs

The script: setup-translater.sh

CommandWhat it does
(none) or --install.env, image, startup, model download
--translate <gruppo/progetto|all>puts in queue immediately
--count <gruppo/progetto>how many files and pieces need translating, without translating
--test <file.md|file.svg> [lingua]from the PC: translates a file and places it next to it (with PNG previews for SVGs)
--status · --logsqueue and latest runs · follows the log
--model <nome>changes model
--start · --stop · --restart · --update · --uninstallthe containers

License

MIT, see LICENSE. The base model has its own license (Gemma Terms of Use).