Skip to content

Studio

What is it?#

A web-based translation editor that runs locally. It lets you browse, edit, and save translations in real time from the browser. Multiple users can work simultaneously — edits are synced via WebSocket.

Studio requires extra dependencies:

pip install doti18n[studio]

Example#

Imagine you have this structure:

project_root/  
├── locales/  
│   ├── en.yaml
│   └── fr.yaml
└── main.py  

en.yaml:

greeting: "Hello, World!"
menu:
  save: "Save"
  open: "Open"

fr.yaml:

greeting: "Bonjour le monde!"
menu:
  save: "Sauvegarder"
  open: "Ouvrir"

First, create a user:

doti18n studio add-user admin mypassword

Then start the server:

doti18n studio run locales/

Open http://127.0.0.1:5000, log in, and you'll see all your locales and keys ready to edit.

What happens under the hood#

Key Locking: When you click a key to edit it, the server locks it for you. Other users see it's taken and can't overwrite your work.


Live Updates: When someone saves a change, every other connected client gets the update instantly — no refresh needed.


Auto-Save: The server doesn't write to disk on every keystroke. It waits 2 seconds of inactivity before flushing changes. On shutdown (Ctrl+C / SIGTERM), all pending edits are saved automatically.


Authentication: All routes are protected. Sessions live in memory with a 1-hour TTL by default, so users will need to log back in after a server restart.

Note

User credentials are stored in studio_users.json in the current directory. Passwords are hashed (PBKDF2), never stored in plain text.

Options#

Add users: Create as many accounts as you need. Re-adding an existing username overwrites the old password.

doti18n studio add-user translator1 p@ssw0rd

Set the default locale: Change which locale is treated as the source of truth (default is en).

doti18n studio run locales/ --locale fr

Change host and port: By default it binds to 127.0.0.1:5000.

doti18n studio run locales/ --host 0.0.0.0 --port 8080

Warning

Binding to 0.0.0.0 exposes the studio to your network. Use a reverse proxy with HTTPS if you're not on localhost.

Session lifetime: Override the default 1-hour TTL with an environment variable.

export DOTI18N_SESSION_TTL=7200

Auth file location: By default it's studio_users.json in the working directory. Override it if needed.

export DOTI18N_AUTH_FILE=/path/to/users.json

Max attempts: Limit how many times a user can try to log in before being temporarily blocked (default is 5).

export DOTI18N_MAX_ATTEMPTS=3

Ban time: Set how long a user is blocked after exceeding max attempts (default is 86,400 seconds (one day)).

export DOTI18N_BAN_TIME=3600