docs: expand i18n section with supported languages and translation guide

This commit is contained in:
svemagie
2026-04-14 12:57:00 +02:00
parent d584c273b4
commit 84a7a3e0f8
+21 -1
View File
@@ -75,7 +75,23 @@ Expand **Or paste a token manually** and enter a bearer token from your Indiekit
### Language
The plugin follows Obsidian's display language. Set it in **Settings → About → Language**. Currently supported: English (`en`), German (`de`).
The plugin follows Obsidian's display language automatically. Set it in **Settings → About → Language**.
| Code | Language |
|---|---|
| `en` | English |
| `de` | German |
#### Adding a translation
1. Copy `src/lang/en.ts` to `src/lang/<code>.ts` (e.g. `pt-BR.ts` → use code `pt`)
2. Translate every string value — keep all `{placeholder}` tokens unchanged
3. Register the locale in `src/i18n.ts`:
```ts
import { pt } from "./lang/pt";
const locales = { en, de, pt };
```
4. Open a PR — translations are always welcome
---
@@ -222,6 +238,10 @@ src/
IndieAuth.ts PKCE IndieAuth sign-in via GitHub Pages relay
SettingsTab.ts Obsidian settings UI
SyndicationDialog.ts Pre-publish dialog to select syndication targets
i18n.ts t() helper — locale detection and string lookup
lang/
en.ts English strings (source of truth, 63 keys)
de.ts German strings
```
---