Skip to content

Localization OS 1.1.0

Choose a tag to compare

@brentmsummers brentmsummers released this 04 Nov 17:59
· 8 commits to main since this release

Localization OS 1.1.0

Release 1.1.0 rebuilds the translation engine for speed and crash safety. Background work now lives in the
database and survives a restart, an install can run several worker processes beside its web process, Postgres
gets a supported migration path, an optional Rust module speeds up the hottest text functions, and translation
memory moves to exact matching with a new in-context (101%) match and a four-band leverage report.

A default install needs no configuration change: it keeps one process on its current database. Read the
upgrade notes below before upgrading, especially if you use fuzzy TM matching today.

Highlights

  • Work that survives a restart. The database job queue is now the default: queued and running background
    jobs (translations, exports, connector syncs, TM imports) are kept across a restart instead of being lost or
    failed. Workflow runs are checkpointed after every step and resume from the step they were on after a restart
    or a deploy; each step visit is recorded once, so finished steps are never run or billed twice.
  • Worker processes. One web process can hand all background work to worker processes started with
    python -m app.worker. Choose the role with LOC_TMS_ROLE (all, the default single process; web; or
    worker). In the container, LOC_TMS_WORKER_PROCESSES=N starts N workers beside the web process and supervises
    them, and LOC_TMS_WEB_PROCESSES=N runs several web processes. Exactly one worker runs the scheduler.
  • Fair scheduling. Customers take turns, a document's languages start and reach review together, started work
    finishes before new work starts, and a long run hands its slot over between steps instead of holding it to the
    end. Short jobs such as exports have their own worker pool and never wait behind long translations.
  • Faster everywhere. Fewer database statements per translate job and per editor save, audit-chain writes
    committed in groups (every caller still waits for its own row; the chain format and verification are
    unchanged), lighter request handling, live progress shared across processes, and on Postgres automatic retry of
    write conflicts and reuse of query plans across pooled connections.
  • Big TMX imports in the background. A large TMX upload is streamed to disk and imported by a background job
    with progress on the page, the API, the CLI and MCP, in about the same memory whatever the file size (up to
    TMX_IMPORT_MAX_BYTES, 2 GiB, and TMX_IMPORT_MAX_UNITS, 5,000,000 units). Imports into the same project run
    one at a time in the order they were submitted and can no longer lose units to each other.
  • Postgres for multi-process installs. Postgres is the recommended database once an install runs more than
    one process; SQLite stays supported and remains the default. loc-tms db copy-to-postgres copies an existing
    SQLite install into an empty Postgres database in one all-or-nothing transaction. See
    docs/guides/postgres-migration.md.
  • Optional native module. locos_native, a Rust module, speeds up TM normalization and hashing, the tag check
    and the built-in sentence splitter. Results are byte for byte the same as the Python functions, which stay as
    the fallback. The Docker image builds it by default; source installs can build it by hand
    (docs/guides/native-module.md) or skip it.
  • Exact TM with in-context matches and a leverage report. TM fills a segment on an exact match (100%) and now
    also reports a 101% in-context match when the previous and next source segments (or, for software strings, the
    key) match too; 101% fills are locked hard by default (tm_lock_ice). The project page shows a leverage report:
    source words per target language in four bands (101% in context, repetitions, 100% exact, new), with a CSV
    download. The same report is project leverage and job leverage on the CLI (--csv),
    GET /api/projects/{id}/leverage and GET /api/jobs/{id}/leverage on the API, and a view in MCP. TMX export
    writes the context so a round trip keeps 101% matches.

Security and dependencies

  • Pillow 13, certifi, the OpenTelemetry API package the MCP SDK pulls in, filelock and setuptools updated for
    published advisories. Pillow 13 needs Python 3.11, so Python 3.11 is now the minimum.
  • The Docker base images are re-pinned by digest (Python slim and Tailscale), and the Rust toolchain used by the
    native build stage comes from a digest-pinned image; only the compiled module reaches the runtime image.

Changed or removed

  • Fuzzy TM matching is removed. There are no more 75 to 99% TM suggestions or fills. The settings
    tm_fill_threshold, tm_fuzzy_lock_mode and tm_context_floor (global and per TM match step) are removed. A
    fill threshold of 100 or blank is still accepted and does nothing; any other value, and any value for the other
    two, is refused on every surface with a message that names the change. The CLI flags --fill-threshold,
    --fuzzy-lock-mode and --context-floor are hidden and refused the same way (--fill-threshold 100 is still
    accepted), and an API min_score below 100 is refused.
  • Leverage has four bands instead of seven. Scripts that read the old seven-band leverage output need
    updating. Vendor rate cards price the same four bands: stored cards load with their fuzzy rates dropped, and
    saving a card with fuzzy rates is refused. Vendor XLIFF exports no longer write fuzzy-match data (imports still
    read it).
  • No TM examples in prompts from the core. Few-shot TM examples in translation prompts came from the fuzzy
    scorer and go with it. A step that asks for examples gets none unless an add-on supplies them, so prompt text
    changes for such workflows.
  • job_queue_backend defaults to db. The in-memory queue stays available as an opt-out
    (loc-tms config set job_queue_backend memory); the split web and worker roles need the database queue.
  • In the web role a launch answers "queued" and the run shows QUEUED until a worker takes it (usually well under a
    second). Scripts that expected running right after a launch must accept queued.
  • An API key's last-used time is now recorded to the minute.

Upgrade notes for existing installs

  1. Back up first, with the app stopped (loc-tms db backup-full). Rolling back after the new migrations ran
    means restoring this backup: the older version does not start on the newer schema.
  2. Python 3.11 or newer. Recreate the virtual environment if you run from source on 3.10.
  3. Check what uses fuzzy TM: TM match steps with a fill threshold below 100 or a fuzzy lock mode
    (loc-tms workflow show <id>), the global tm_fill_threshold and tm_fuzzy_lock_mode, and vendor rate cards
    with fuzzy rates. After the upgrade those steps fill exact and 101% matches only. A workflow exported before the
    upgrade that carries the removed keys must have them taken out before it is imported again.
  4. Migrations run on their own at the first start (init_db runs alembic upgrade head; the container
    entrypoint does the same on Postgres). Seven new revisions, in the order they run after 1.0.0's head
    f2c8a6d4b1e7; the new head is e5a1c9d3b7f2:
    1. a7e3c9d1f4b2 two nullable columns on customers and projects, reserved for an add-on; they stay empty
      without it.
    2. b8d4f2a6c1e9 the liveevent table (cross-process live events, rows kept for minutes).
    3. b4d8e2f6a9c1 engine reliability: run owner, heartbeat and resume count; step checkpoints with a unique
      idempotency key; job retries; queue retry fields.
    4. c5a1e9d3b7f2 the sharedstate table (used only with more than one web process).
    5. d7b3f1a9c2e4 an index on target locales by project.
    6. d6b3f8a2c4e1 segmenttm.context_key, backfilled once from approved segments still in the database; it
      also drops the three removed fuzzy columns of workflow steps. This is the one revision whose time grows with
      your data: time it on a copy of a large install.
    7. e5a1c9d3b7f2 jobqueue.serial_key and two indexes, so a project's TM imports run one at a time.
  5. The first start moves to the database queue unless the install has an explicit job_queue_backend=memory
    setting. On that first start in the default single-process role, jobs the old in-memory queue left queued are
    run and jobs it left running are failed with "Interrupted by a server restart.", as a restart always did. If
    you plan to use worker processes, start once in the default role before turning them on.
  6. Workflow runs left running by the old version are failed at the first start, as before; paused and queued
    runs are untouched. From then on runs resume after a restart. The step that was in flight when a process died
    runs again, so its engine calls are made and billed again; completed steps never are.
  7. Shutdown. Workers stop claiming and give running jobs LOC_TMS_DRAIN_SECONDS (default 8 s) to finish; the
    rest are re-queued. Keep the container stop grace above that (about 40 s with worker processes).
  8. Large TMX imports need free disk of about three times the file across the OS temp folder and the data
    folder while they run. A reverse proxy that caps request bodies still caps uploads.
  9. Staying single-process needs nothing: LOC_TMS_ROLE unset is the old layout. To use more cores, set
    LOC_TMS_WORKER_PROCESSES in the container (or run python -m app.worker processes yourself) and consider
    Postgres; on Postgres keep (web + worker processes) x (LOC_TMS_DB_POOL_SIZE + LOC_TMS_DB_MAX_OVERFLOW + 2)
    under max_connections (the web process warns when it does not fit).
  10. Moving to Postgres is optional: follow docs/guides/postgres-migration.md (rehearse on a copy first).
  11. The native module is optional and switched off with LOCOS_NATIVE=0; build an image without it with
    --build-arg WITH_NATIVE=0.

Known limitations

  • On SQLite the split roles work on one machine, but saves and concurrent imports are bound by SQLite's single
    writer; use Postgres for more than a couple of workers.
  • A source used in several contexts is a 101% match only in the context it was last approved in, and 100%
    elsewhere.
  • Rows imported or approved before the upgrade without a matching approved segment have no context and match at
    100% only.