World's first open-source enterprise world model.
0004 · Language follows the reader of each text
- Status: Implemented · open: the UI does not guess the browser language
- Written: 2026-08-29 · condensed into English 2026-09-03
- Related: 0001 made
descriptionload-bearing; 0003 separatedreasonfromdescription; 0008 supplies the English packs a Chinese knowledge base starts from.
The problem
One language switch cannot serve five kinds of text with different readers and sources:
| Text | Reader | Source |
|---|---|---|
| UI strings ("Import an ontology") | people | the i18n bundle |
| Server errors ("Password must be at least 8 characters") | people | Rust |
Ontology label / description |
the model reads description |
packs, users, OWL import |
LLM text generated on the spot (a suggested reason) |
people | the model, on demand |
Extracted data (张三, surface_predicate "runs on") |
people and the model | the document, verbatim |
The last row is not copy. It is a quotation.
Decisions
- UI strings are a per-person client setting, like dark mode: a foreign colleague in
a Chinese company should not need an administrator to see English. Kept in
localStorageviamakeStore, resolved in one function that everything else consumes. The Chinese bundle isconst zh: typeof S = { … }: a missing key fails compilation, wherePartialwith fallback would leave a silently English line. - Server errors become keys. With the locale in the client, any string left in Rust
is permanently untranslatable. Errors a user can hit are
AppError::Invalidwith acodefor the frontenderr.*table (the Englishmessagestays for MCP, CLI and logs). API-contract guards (role must be admin, editor or viewer) stay EnglishValidation: their reader is a developer. Hence a hard rule: the server produces no display text. - Ontology
descriptionfollows the corpus. It goes verbatim into the extraction prompt beside the documents, and Chinese UI with English class descriptions is common. So it is a knowledge-base property,knowledge_bases.ontology_lang, whose deployment default is named "default ontology language for new knowledge bases"; call it "system language" and someone will hang the UI language on it. labelis data and follows no switch. A class a Chinese team named人物reads人物on the English UI too: it is their concept.keyis never translated; it is the model's token. The prompt listskey+description,labelonly when the description is empty:Personbesidepersonadds nothing and mixes scripts.- LLM text for people takes
localefrom the request.reasonis generated when someone clicks "Suggest with AI", so the caller states the language;label/descriptionin the same call followkb.ontology_lang.lang_name()sendsChineserather thanzh; the cold-start path passesen. - Extracted data stays verbatim. An entity is
张三because paragraph 3 says so; translating it breaks the evidence match, splits one person across Chinese and English documents, and emptiessurface_predicate. Provenance has no switch.
Dead ends
- UI language as a deployment-level admin setting, "like the concurrency limit". That limit describes the deployment; the UI language describes the reader. A setting lives with whatever it describes.
- A Chinese rewrite of the built-in ontology (9 classes, 14 relations, negative
examples included) lost its object when seeding was removed (#125, #128,
0009, 0010). A
Chinese knowledge base now starts from an all-English pack;
ontology_lang = zhaffects only terms the LLM proposes later. What remains is an imported vocabulary or packs with Chinese labels (0008, open question).
Revisions
- 2026-09-02: "guess
navigator.languageonce" was never shipped, deliberately:detect()readslocalStorageand otherwise returns"en", because the Chinese bundle trails the English one and untranslated lines fall back silently. The line goes back in when the bundle catches up. - 2026-09-02: since #112
suggestwritesontology_proposals(0003); the language conclusion is unchanged.
Open questions
- Bundle drift:
typeof Scatches a missing key but not "the English wording changed and the Chinese did not". Edit both together. - Mixed-language corpora in one knowledge base: one language per KB; design it when it happens.
Status history
The status line as it stood on 2026-09-27, before status lines were cut to one line:
Built · UI strings in
web/src/i18n/; user-reachable server errors carry acode(AppError::Invalid, 81 sites; 23Validationguards stay English), and so do the chat stream'serrorframes, in the same{error, code}body (2026-09-26);descriptionfollowsknowledge_bases.ontology_lang; LLM output for people takeslocalefrom the request; extracted data stays verbatim; the chat's step trail carries fields the client words (status, counts, moments), and keeps its Englishdetailfor stored messages (2026-09-26); the UI does not guess the browser language yet.