Skip to content
Docent Docs

Getting Started

Localization

Translate the reader UI through standard Laravel language files, and let the Assistant answer in the reader's language.

Docent's documentation content is yours to write in whatever language your readers speak. This page covers the other half: the interface strings Docent itself renders, and the language the Assistant answers in.

Translating the UI

Every string in the reader, search, widget, and Assistant interfaces — button labels, placeholders, screen-reader announcements — lives in a standard Laravel language file under the docent namespace. Out of the box they're English. To translate them, publish the file:

bash
php artisan vendor:publish --tag=docent-lang

That copies lang/vendor/docent/en/ui.php into your application. Create a sibling directory for each locale you support and translate the values:

text
lang/vendor/docent/
├── en/ui.php
└── es/ui.php

Docent renders in whatever locale your application has set, the same App::setLocale() your app already uses. There's no separate Docent locale setting; if your middleware puts a Spanish-speaking user in the es locale, their help center chrome is Spanish.

Two details worth knowing:

  • Strings used by Docent's JavaScript (the copy buttons, Assistant status announcements) are passed from the server with English fallbacks baked into the bundle. A missing key degrades to English rather than breaking.

  • The published file is a copy, like published views. When an update adds new strings, your published file won't have them and the English defaults apply until you merge. If you only need a few overrides, keep your published file small: Laravel falls back per key.

The admin panel is not translated yet. It's a staff-facing surface, and we'd rather do it properly than half-translate it now.

Assistant answers in the reader's language

Your docs might be written in English while your readers work in German. Since the Assistant generates every answer, it can translate at answer time — one set of docs, answers in any language:

php
'ai' => [
    // ...
    'language' => 'viewer',
],

Three settings:

  • null (the default): no instruction is added; the model answers in the language of the docs.

  • 'viewer': answer in the application locale of the request, so it follows the same App::setLocale() that drives the UI translation above.

  • a fixed code like 'de' or 'pt-BR': always answer in that language, whatever the docs or the viewer's locale.

Everything else about answers is unchanged: grounding, citations, and placeholder handling work exactly as before, and answer caching keeps different languages separate so a Spanish reader never receives a cached German answer.

Translated content

Deliberately not a feature yet. If you need fully translated documentation trees today, multi-site works well: give each language its own site (docs at /docs, docs-es at /es/docs) with its own content directory, navigation, and name. Each gets its own search index and Assistant corpus in the right language for free.