mirror of
https://github.com/svemagie/obsidian-micropub.git
synced 2026-05-14 19:38:50 +02:00
docs: expand i18n section with supported languages and translation guide
This commit is contained in:
@@ -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
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
Reference in New Issue
Block a user