mirror of
https://github.com/MarekWo/mc-webui.git
synced 2026-08-07 09:12:57 +02:00
docs(i18n): state the catalog filename rule and where to install it
A catalog whose filename does not match ^[a-z]{2}(-[A-Z]{2})?$ is ignored
silently by available_languages() — no error, no log line, no entry in the
dropdown. pt-br.json, hu_HU.json and hungarian.json all fail that way, and the
guide gave no way to find out. Verified against the running container: hu.json
appeared as "Magyar" with three keys and the rest falling back to English,
while pt-br.json, hungarian.json and a de.json with a broken body were all
skipped without affecting the app.
Also spells out that app/translations/ lives inside the image and needs a
rebuild, so the config-directory drop-in is the one to reach for.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
+17
-1
@@ -56,6 +56,16 @@ when a translation drops one of these terms.
|
||||
|
||||
## 2. Adding a language
|
||||
|
||||
### Name the file correctly
|
||||
|
||||
The filename **is** the language code, and it must be a two-letter code, optionally
|
||||
followed by an uppercase region: `hu.json`, `de.json`, `pt-BR.json`, `zh-CN.json`.
|
||||
|
||||
A file that does not match that shape is **ignored silently** — no error, no entry in the
|
||||
Language dropdown, nothing in the log. `pt-br.json`, `PT-BR.json`, `hungarian.json` and
|
||||
`hu_HU.json` all fail this way. If your language does not appear after a refresh and the
|
||||
⟳ button, check the filename first.
|
||||
|
||||
### Get the file to work from
|
||||
|
||||
```bash
|
||||
@@ -81,13 +91,19 @@ itself. The other `meta.*` keys are optional.
|
||||
### Install it on your server
|
||||
|
||||
Drop the file into the `translations` folder inside your config directory — the same
|
||||
volume that holds the database. With the stock `docker-compose.yml` that is:
|
||||
volume that holds the database (`/data` inside the container, `MC_CONFIG_DIR` on the
|
||||
host). With the stock `docker-compose.yml` that is:
|
||||
|
||||
```bash
|
||||
mkdir -p ./data/translations
|
||||
cp hu.json ./data/translations/
|
||||
```
|
||||
|
||||
> Putting the file in `app/translations/` instead also works, but that folder is baked
|
||||
> into the container image — it needs `docker compose up -d --build`. Use it only when
|
||||
> you are contributing the language back to the project. The config directory is the
|
||||
> one that needs no rebuild and survives an update.
|
||||
|
||||
Refresh the browser. The language appears in **Settings → Appearance → Language**
|
||||
immediately; no restart is needed. If it does not show up (some network filesystems
|
||||
report file timestamps too coarsely), click the ⟳ button next to the dropdown.
|
||||
|
||||
Reference in New Issue
Block a user