docs: add furniture import auto-translation guide
This commit is contained in:
1 parent
8174ffa6af
commit
b5c8a29956
1 file changed
+53
@@ -564,6 +564,59 @@ Supports Cloudflare Turnstile and Google reCAPTCHA. Configure via CMS Settings.
|
||||
|
||||
12 preset themes with fully customizable colors via **Admin → Theme** (`/admin/theme`).
|
||||
|
||||
|
||||
## Furniture Import with Auto-Translation
|
||||
|
||||
The CMS now automatically translates furniture names and descriptions to **13 languages** on every import:
|
||||
|
||||
- **Native languages** (via official Habbo gamedata): Dutch (`nl`), English (`en`), German (`de`), French (`fr`), Spanish (`es`), Turkish (`tr`), Italian (`it`)
|
||||
- **Additional languages** (via LibreTranslate self-hosted Docker at `127.0.0.1:5000`): Portuguese (`pt`), Finnish (`fi`), Polish (`pl`), Russian (`ru`), Arabic (`ar`), Japanese (`ja`)
|
||||
|
||||
### How it works
|
||||
|
||||
1. **Per-import translation** — Every import route (`/admin/import/furni`, batch, batch-regen, clone) triggers translation automatically after the furniture data is imported.
|
||||
|
||||
2. **Translation flow**:
|
||||
- The original (usually English) `classname` and `description` are sent to LibreTranslate
|
||||
- Official Habbo translations take priority for the 7 supported languages
|
||||
- Custom/new meubels fall back to LibreTranslate
|
||||
- Post-processing rules force Habbo‑style terminology (e.g. `bank` → `Bank`, `tafel` → `Tafel`, `stoel` → `Stoel`)
|
||||
|
||||
3. **No manual steps needed** — The translation happens as part of the import API calls. New custom furniture added via import immediately appears with translated names in the catalog for all 13 languages.
|
||||
|
||||
4. **CLI scripts** (optional):
|
||||
- `pnpm translate:full` — translate all furniture data fully (uses `--full` flag)
|
||||
- `pnpm translate:limited [--limit N] [--concurrency N]` — translate limited amount per language
|
||||
- `pnpm build:languages [--full] [--limit N] [--concurrency N]` — build the full localized furnidata JSON files
|
||||
|
||||
### Requirements
|
||||
|
||||
- LibreTranslate Docker container running at `http://127.0.0.1:5000` (or configure a different URL in the environment)
|
||||
- The `LIBRETRANSLATE_URL` environment variable can override the default if needed
|
||||
- For the 7 official languages, no external service is needed — they use the built‑in Habbo gamedata
|
||||
|
||||
### Environment variables
|
||||
|
||||
```dotenv
|
||||
# LibreTranslate endpoint (default: http://127.0.0.1:5000)
|
||||
LIBRETRANSLATE_URL=http://127.0.0.1:5000
|
||||
```
|
||||
|
||||
### Example import flow
|
||||
|
||||
```bash
|
||||
# Single furniture import (triggers translation)
|
||||
POST /admin/import/furni
|
||||
|
||||
# Batch import (triggers translation)
|
||||
POST /admin/import/furni/batch
|
||||
|
||||
# Regenerate localized files
|
||||
POST /admin/import/furni/batch-regen
|
||||
|
||||
# Clone import (triggers translation)
|
||||
POST /admin/import/clone/batch
|
||||
```
|
||||
### AI Content Moderation
|
||||
|
||||
Optional OpenAI-powered moderation for comments and guestbook posts. Set `OPENAI_API_KEY`.
|
||||
|
||||
Reference in new issue
Block a user