docs: reflect the config, branding, i18n and plugin-API changes

- config.md: add server.guestIdent, report.service, defaults.lang; correct the
  turnstile.enabled / features.* descriptions; add a Languages section; complete example.
- branding.md: branding.name/icon now drive the favicon, notifications, PWA and push;
  fix the feature-flag notes; add a Languages note.
- plugins.md: document orbit.config() and orbit.i18n (language/t/pick) + a Localization
  section; note they arrived in apiVersion 4.
- overview.md: add the 10-language support bullet.
This commit is contained in:
Jean Chevronnet 2026-07-04 01:05:11 +00:00
parent d4d93bfd39
commit 6dfb7631b2
No known key found for this signature in database
4 changed files with 68 additions and 15 deletions

View file

@ -73,6 +73,10 @@ instead. See **[Compiled plugins](https://orbit.tchatou.fr/docs/compiled-plugins
| `orbit.irc.list()` | request the channel list |
| `orbit.themes.current()/list()/set(id)` | read/set the theme |
| `orbit.storage.get(key, def)/set(key, val)` | namespaced persistence |
| `orbit.config()` | the resolved runtime config (branding, features, …) |
| `orbit.i18n.language()` | current UI language code (e.g. `es`, `pt-BR`) |
| `orbit.i18n.t(key, opts?)` | translate an app locale key (supports `{{interpolation}}`) |
| `orbit.i18n.pick(table)` | pick a string from a `{ lang: text }` table by the current language |
| `orbit.addUi(slot, render)` | add UI to a slot (returns a remover) |
| `orbit.addSettingsSection({label, icon?, render})` | add a whole Settings section |
| `orbit.h / orbit.html` | render helpers |
@ -94,6 +98,28 @@ instead. See **[Compiled plugins](https://orbit.tchatou.fr/docs/compiled-plugins
More slots (message decorators, side panels) will be added as the core grows
stable homes for them.
### Localization (i18n)
The UI ships in 10 languages — keep your plugin in step so it isn't stuck in one. Two ways:
- **Self-contained** — carry a `{ lang: text }` table and let Orbit pick the current language:
```js
const LABEL = { en: 'Copy', fr: 'Copier', de: 'Kopieren' };
orbit.html`<button title=${orbit.i18n.pick(LABEL)}>⧉</button>`;
```
- **Interpolated**`orbit.i18n.t('key', { name })` resolves an app locale key with
`{{placeholders}}`, so word order is correct per language. The four bundled plugins
(clock, copy, invite, games) use this.
Read the string **at render time**, not once at load: plugin UI re-renders when the language
changes, so the text follows automatically. `orbit.i18n.language()` returns the current code
if you need to branch.
> `orbit.i18n` and `orbit.config()` were added in **`apiVersion` 4** — guard with
> `if (orbit.apiVersion >= 4)` if your plugin must run on older builds.
## Trust & security
Plugins are **operator-controlled**: a deployment lists them in `config.json`, so