feat: add profile language preferences and refine toast, dropdown and history UI
This commit is contained in:
@@ -10,6 +10,29 @@ RustPad is a collaborative Markdown editor with standalone notes and workspaces.
|
||||
|
||||
The script creates `data/db` and `data/files`, refreshes the generated browser libraries, builds the project, and starts it with Cargo. If Cargo is unavailable, it runs `docker compose up --build` instead; the Docker build downloads the libraries in a separate stage.
|
||||
|
||||
|
||||
## Interface languages
|
||||
|
||||
Frontend translations live in the top-level `lang/` directory and are embedded into the Rust binary during the build. There is no separate language manifest: every `*.json` file is discovered automatically and its `meta` block is used to populate the language selector in the profile.
|
||||
|
||||
```json
|
||||
{
|
||||
"meta": {
|
||||
"code": "pl",
|
||||
"name": "Polish",
|
||||
"native_name": "Polski",
|
||||
"locale": "pl-PL"
|
||||
},
|
||||
"translations": {
|
||||
"common.save": "Zapisz"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
`lang/en.json` is the required fallback and source language. Every language file must have the same translation keys as `en.json`; invalid metadata, non-string values, duplicate codes, or mismatched keys are rejected when the embedded language catalog is initialized. To add a language, copy `lang/en.json`, translate the values, and set `meta.code`, `meta.name`, `meta.native_name`, and `meta.locale`. The filename must match `meta.code` (for example `de.json` and `"code": "de"`).
|
||||
|
||||
The selected interface language is stored in the browser and can be changed from the profile without reloading the page. API responses remain in their original English form; the browser client translates known messages only when presenting them in the UI.
|
||||
|
||||
## Workspace features
|
||||
|
||||
- Real-time collaborative editing over WebSocket.
|
||||
|
||||
Reference in New Issue
Block a user