All posts

6 min readPost 19

Ten languages: keeping the README, the website and the software readable in every one

Translating an open-source project into ten languages once is easy; keeping nine translations from drifting, stopping German and Russian labels from bursting out of SVG boxes, and keeping AI-agent outputs untranslated takes mechanical enforcement. Here is how Obituary tests 40 browser-measured diagrams, go-i18n catalogs, and line-by-line native audits.

On this page
  1. One source of truth, one glossary
  2. Measuring 40 SVG diagrams in a real browser
  3. Software i18n and the strict do-not-translate list
  4. Ten prerendered website locales, zero forced redirects
  5. What scripts could not catch: native line-by-line reviews

Localizing a developer tool into ten languages rarely breaks on day one—it breaks two weeks later. One paragraph changes in English while nine translations silently drift behind, or compact Chinese labels fit cleanly inside a diagram while German and Russian words burst straight through the card border.

Obituary spans four user-facing surfaces: READMEs, website pages, documentation, and the software itself (obit, obitd, and the desktop window). Between 20 and 21 November we rolled out all ten languages together and wired verification straight into the build so consistency no longer depends on memory.

One source of truth, one glossary ​

English README.md is the sole source file; every edit updates all nine sibling files in the exact same commit (Simplified Chinese, Traditional Chinese, Japanese, Korean, Spanish, French, German, Brazilian Portuguese, and Russian) with identical top language bars and SVG flags.

Six domain terms are locked in a shared glossary so translations stay consistent across README, website, and docs (purge stays literal permanent deletion outside Chinese):

English简体中文日本語DeutschРусский
bury下葬埋葬begrabenпохоронить
graveyard墓地墓地Friedhofкладбище
resurrect复活復活wiederbelebenвоскресить
lifespan寿命寿命Lebensdauerсрок жизни
expire到期期限切れablaufenистекать
register登记登録registrierenзарегистрировать

Measuring 40 SVG diagrams in a real browser ​

The README carries two diagrams (lifecycle and delete guard) in light and dark themes across ten languages—40 SVGs in total. Rather than guessing character widths or squashing text horizontally:

  • Every string is measured inside a headless Chromium browser using the real font, plus safety margin measured against wider Verdana fallback.
  • Explanatory copy stays at least 14 px when displayed at 880 px wide.
  • pnpm check inspects live bounding boxes for every text run, card, command box, and arrow—checking overlap, overflow, padding, contrast, orphan characters, line-start punctuation, and exact round-trip text match against strings.json—then repeats under the fallback font.

The checker itself is mutation-tested: pnpm test runs deliberately broken SVGs to prove every rule actually trips when violated. Even after every automated check passes, we still eyeball headless renders of every SVG—scripts catch geometry, not awkward phrasing. Because CI fonts differ from local build fonts, CI verifies SVGs read-only without regenerating them.

Four language versions of the README lifecycle diagram side by side (Simplified Chinese, Japanese, German, Russian): longer German and Russian labels fit cleanly inside their cards
Four of the ten README lifecycle diagrams side by side: despite much longer German and Russian words, every label stays cleanly inside its card.

Software i18n and the strict do-not-translate list ​

The CLI and desktop window use go-i18n with dot-hierarchical IDs defined in internal/i18n/messages.go, paired with active.zh-CN.json and validated by goi18n extract so keys and placeholders stay locked. Both catalogs embed directly into the binaries.

Language resolution follows a fixed order: OBIT_LANG → ui.language → LC_ALL → LC_MESSAGES → LANG → OS locale. Traditional Chinese tags (zh-TW, zh-HK, zh-MO) never fall back to Simplified Chinese; they resolve to English.

Equally important is the do-not-translate list keeping machine- and agent-consumed strings byte-stable (hook execution paths never even load i18n catalogs):

  • Delete-guard and hook denial text and suggested commands
  • Host protocol responses, MCP tool names, and MCP descriptions
  • JSON fields, exit codes, paths, version prefixes, log tags, registry keys, and Wails wire fields
Terminal output showing check-readme-i18n.py passing across all 10 READMEs and 40 SVGs alongside six passing go-i18n package tests confirming complete catalogs and no silent fallback
Static README/SVG verification paired with Go i18n catalog tests: missing strings fail tests immediately instead of falling back silently.

Ten prerendered website locales, zero forced redirects ​

By early 21 November the landing site and docs shipped across all ten locales (/ for Simplified Chinese, /en/ for English, /zh-TW/ for Traditional Chinese, /<lang>/ for the rest). Every page prerenders full <html lang>, mutual hreflang links, canonical, sitemap.xml, and robots.txt.

If a visitor's browser language differs from the current page, a quiet banner offers a one-click switch in their own language without ever auto-redirecting. Traditional Chinese, Japanese, and Korean use native system fonts, while Simplified Chinese loads a tight subset of Noto Sans SC.

Screenshot of the website language menu listing all ten locales with flag icons and English checked
The website language switcher covering all ten locales, marking the active language cleanly.

What scripts could not catch: native line-by-line reviews ​

Automated checks verify missing keys and overflowing pixels, not semantic blunders. Running dedicated line-by-line passes across all ten locales caught real mistakes immediately:

  • Japanese labeled the Undo button as "Redo" instead of 元に戻す.
  • Spanish translated "restorable for 7 days" as "can be resurrected 7 days."
  • German had seven mismatched prepositions around "in the graveyard" (corrected to auf den / auf dem Friedhof).
  • Russian labeled Undo as "Cancel."
  • Non-Chinese pages embed the English desktop demo (whose second tab reads Graveyard), yet copy translated from Chinese called it "Cremating soon," contradicting the live UI—standardized to "Graveyard" everywhere.
  • Empty contributor-slot labels truncated past 119 px in five locales; shortening them fixed overflow at both 1440 px desktop and 390 px mobile widths.

Eight localized docs homepages were rewritten the same morning to match the glossary, with build-time translation and placeholder checks locked into both site builds.

All posts