docs(i18n): add Angular host/player key-map bootstrap for MVP flow (#220)
This commit is contained in:
69
docs/i18n-keymap.md
Normal file
69
docs/i18n-keymap.md
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
# i18n key-map bootstrap (Angular host/player MVP)
|
||||||
|
|
||||||
|
Issue: #220
|
||||||
|
Scope: Lobby → Join → Start round → Round → Reveal → Scoreboard
|
||||||
|
Locales: `en`, `da`
|
||||||
|
|
||||||
|
This document is the gameplay key-namespace map for Angular host/player MVP.
|
||||||
|
It maps existing text keys only (no feature expansion) and stays aligned with `shared/i18n/lobby.json`.
|
||||||
|
|
||||||
|
## Key families
|
||||||
|
|
||||||
|
- `frontend.ui.host.*` — host-facing gameplay actions and status text.
|
||||||
|
- `frontend.ui.player.*` — player-facing gameplay actions and status text.
|
||||||
|
- `frontend.ui.common.*` — shared labels used across host/player views.
|
||||||
|
- `frontend.errors.*` — user-facing error keys shown by frontend.
|
||||||
|
- `backend.error_codes.*` / `contract.backend_to_frontend_error_keys.*` — backend code → frontend key bridge.
|
||||||
|
|
||||||
|
## Gameplay flow key map
|
||||||
|
|
||||||
|
| Flow step | Family | Key | en | da |
|
||||||
|
|---|---|---|---|---|
|
||||||
|
| Lobby | `frontend.ui.host` | `host.title` | Host gameplay flow | Vært gameplay-flow |
|
||||||
|
| Lobby | `frontend.ui.player` | `player.title` | Player gameplay flow | Spiller gameplay-flow |
|
||||||
|
| Lobby | `frontend.ui.common` | `common.session_code` | Session code | Sessionskode |
|
||||||
|
| Lobby | `frontend.ui.player` | `player.nickname` | Nickname | Kaldenavn |
|
||||||
|
| Join | `frontend.ui.player` | `player.join` | Join | Join |
|
||||||
|
| Start round | `frontend.ui.host` | `host.start_round` | Start round | Start runde |
|
||||||
|
| Round | `frontend.ui.host` | `host.show_question` | Show question | Vis spørgsmål |
|
||||||
|
| Round | `frontend.ui.player` | `player.lie_label` | Lie | Løgn |
|
||||||
|
| Round | `frontend.ui.player` | `player.submit_lie` | Submit lie | Send løgn |
|
||||||
|
| Round | `frontend.ui.player` | `player.submit_guess` | Submit guess | Send gæt |
|
||||||
|
| Reveal | `frontend.ui.host` | `host.mix_answers` | Mix answers → guess | Bland svar → gæt |
|
||||||
|
| Reveal | `frontend.ui.host` | `host.calculate_scores` | Calculate scores → reveal | Udregn score → afslør |
|
||||||
|
| Scoreboard | `frontend.ui.host` | `host.load_scoreboard` | Load scoreboard | Hent scoreboard |
|
||||||
|
| Scoreboard | `frontend.ui.host` | `host.final_leaderboard` | Final leaderboard | Finale leaderboard |
|
||||||
|
| Scoreboard | `frontend.ui.player` | `player.final_leaderboard` | Final leaderboard | Finale leaderboard |
|
||||||
|
| Scoreboard | `frontend.ui.common` | `common.points_short` | pts | point |
|
||||||
|
|
||||||
|
## Frontend error keys used in flow scope
|
||||||
|
|
||||||
|
| Error family | Key | en | da |
|
||||||
|
|---|---|---|---|
|
||||||
|
| Join | `frontend.errors.session_code_required` | Session code is required. | Sessionskoden er påkrævet. |
|
||||||
|
| Join | `frontend.errors.session_not_found` | Session code is invalid or the session no longer exists. | Sessionskoden er ugyldig, eller sessionen findes ikke længere. |
|
||||||
|
| Join | `frontend.errors.nickname_invalid` | Nickname must be between 2 and 40 characters. | Kaldenavn skal være mellem 2 og 40 tegn. |
|
||||||
|
| Join | `frontend.errors.nickname_taken` | Nickname is already taken. | Kaldenavnet er allerede taget. |
|
||||||
|
| Join | `frontend.errors.join_failed` | Join failed. Check code or nickname and try again. | Kunne ikke joine. Tjek kode eller kaldenavn og prøv igen. |
|
||||||
|
| Start round | `frontend.errors.start_round_failed` | Could not start round. Refresh the lobby and try again. | Kunne ikke starte runden. Opdater lobbyen og prøv igen. |
|
||||||
|
| Any | `frontend.errors.unknown` | Action failed. Refresh status and try again. | Handlingen fejlede. Opdater status og prøv igen. |
|
||||||
|
|
||||||
|
## Backend→frontend mapping for gameplay errors
|
||||||
|
|
||||||
|
Mapped in `contract.backend_to_frontend_error_keys` (source: `shared/i18n/lobby.json`):
|
||||||
|
|
||||||
|
- `session_code_required` → `session_code_required`
|
||||||
|
- `nickname_invalid` → `nickname_invalid`
|
||||||
|
- `session_not_found` → `session_not_found`
|
||||||
|
- `session_not_joinable` → `join_failed`
|
||||||
|
- `nickname_taken` → `nickname_taken`
|
||||||
|
- `category_slug_required` → `start_round_failed`
|
||||||
|
- `category_not_found` → `start_round_failed`
|
||||||
|
- `round_start_invalid_phase` → `start_round_failed`
|
||||||
|
- `round_already_configured` → `start_round_failed`
|
||||||
|
- `host_only_action` → `start_round_failed`
|
||||||
|
|
||||||
|
## Notes
|
||||||
|
|
||||||
|
- This is a bootstrap key-map doc for MVP mergeability.
|
||||||
|
- The key/value source of truth remains `shared/i18n/lobby.json`.
|
||||||
Reference in New Issue
Block a user