Elixir / Phoenix
Phoenix is the runtime Dialecto was built against first. Your gettext
domains map straight onto the editor, and validation agrees with what
Elixir’s Gettext actually does at runtime — %{} placeholder parity
and plural forms included.
Setup
- Register the repo in Dialecto (Repos → New, framework: Elixir/Phoenix). If you block read access, copy the scan token your CI will need; it’s shown once.
- Connect GitHub for PR output: the Dialecto GitHub App where your deployment has it configured, or a fine-scoped personal access token (encrypted at rest). See GitHub App.
Scanning
Extract and merge your catalogs the way Phoenix already does it:
mix gettext.extract --merge
By default the GitHub App reads priv/gettext/** from the pushed
commit. To send usage snippets, or if you blocked read access, your CI
posts the scan instead. That scan is one HTTP call carrying your .po/.pot files, the git
SHA and branch, and (recommended) the source snippets around your
gettext calls — those power in-place context and the rename rewrite.
The payload contract and a CI recipe are in
Scanning & CI; wire it to run on pushes to the
branches you care about.
Branch scanning: by default Dialecto tracks the branches you select; switch the repo to scan-all with a branch regex if you want every feature branch localized as it develops.
Editing
The catalog mirrors your priv/gettext structure: locales × domains.
Work a domain at a time; each entry shows its translations side by
side and the code that uses it. Validation runs as you edit:
%{name}placeholders must survive translation — missing or invented ones are flagged.- Plural entries expect the locale’s plural-form count (read from the
catalog’s own
Plural-Forms:header). - Glossary terms are checked against your organization’s glossary.
Everything you save stages into a minimal diff — preview it any time, then submit for review and batch the approved set into a PR targeting the branch you choose.
In-context editing
The dialecto_in_context add-on lets you open your running Phoenix app,
click any text and edit it in the Dialecto sidebar, in the language of
your .po files, with plural forms and placeholders handled for you.
It is an opt-in, dev-only dependency: you add it to your Mix project
with two guarded lines, in the backend and the endpoint, that compile
away in test and production. It marks text only while the editor is
open. Edits land as drafts that ship as the same minimal-diff pull
request as any other change.
The merge gate on your PRs
Enable the completeness check in the repo’s settings (pick required
locales), then make Dialecto/translations a required status check
in your GitHub branch protection. From then on, a PR that introduces
untranslated strings in a required locale fails the check, and its
details link lands the author directly on the strings to fix.
incremental scope (the default) means pre-existing gaps don’t block
anyone — see The merge gate.
Renames that fix your code
Renaming a msgid in Dialecto computes rewrites for every recorded
gettext("...") call-site and ships them with the PR; ambiguous sites
are listed for manual follow-up instead of guessed at. Details in
Source call-site rewrite.
Grounded suggestions
Machine-translation suggestions run local-first and are grounded in
your domains, usage, and brand voice.
For hands-off catalogs, translation_mode can autofill through the
review flow — see Translation aids.