From 784622058ad7c3d355b217dd23d3d18116e6c85d Mon Sep 17 00:00:00 2001 From: DEV-bot Date: Sun, 1 Mar 2026 22:38:54 +0000 Subject: [PATCH 1/3] docs(i18n): add Angular host/player key-map bootstrap for MVP flow (#220) --- docs/i18n-keymap.md | 69 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 docs/i18n-keymap.md diff --git a/docs/i18n-keymap.md b/docs/i18n-keymap.md new file mode 100644 index 0000000..3b22679 --- /dev/null +++ b/docs/i18n-keymap.md @@ -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`. From bc78f79f78f4db28012bafcfe6b11e4d77571f47 Mon Sep 17 00:00:00 2001 From: Asger Geel Weirsoee Date: Sun, 1 Mar 2026 22:42:22 +0000 Subject: [PATCH 2/3] docs(i18n): align issue-220 families and contract mapping --- docs/i18n-keymap.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/i18n-keymap.md b/docs/i18n-keymap.md index 3b22679..9c5becf 100644 --- a/docs/i18n-keymap.md +++ b/docs/i18n-keymap.md @@ -9,11 +9,10 @@ It maps existing text keys only (no feature expansion) and stays aligned with `s ## 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. +- `host` — `frontend.ui.host.*` host-facing gameplay actions and status text. +- `player` — `frontend.ui.player.*` player-facing gameplay actions and status text. +- `system` — shared UI labels used across host/player views (implemented under `frontend.ui.common.*` in `shared/i18n/lobby.json`). +- `errors` — user-facing error keys shown by frontend (`frontend.errors.*`) plus backend code → frontend key bridge via `backend.error_codes.*` / `contract.backend_to_frontend_error_keys.*`. ## Gameplay flow key map @@ -21,7 +20,7 @@ It maps existing text keys only (no feature expansion) and stays aligned with `s |---|---|---|---|---| | 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 | `system` (`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 | @@ -34,7 +33,7 @@ It maps existing text keys only (no feature expansion) and stays aligned with `s | 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 | +| Scoreboard | `system` (`frontend.ui.common`) | `common.points_short` | pts | point | ## Frontend error keys used in flow scope @@ -52,6 +51,8 @@ It maps existing text keys only (no feature expansion) and stays aligned with `s Mapped in `contract.backend_to_frontend_error_keys` (source: `shared/i18n/lobby.json`): +> Note: `host_only_action` is **not** part of the current shared contract mapping and is intentionally not listed here. + - `session_code_required` → `session_code_required` - `nickname_invalid` → `nickname_invalid` - `session_not_found` → `session_not_found` @@ -61,7 +62,6 @@ Mapped in `contract.backend_to_frontend_error_keys` (source: `shared/i18n/lobby. - `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 From c7ff3d96de73fdeca13096980825eccc9aa284e0 Mon Sep 17 00:00:00 2001 From: DEV-bot Date: Sun, 1 Mar 2026 22:51:13 +0000 Subject: [PATCH 3/3] docs(i18n): normalize flow table to host/player/system families --- docs/i18n-keymap.md | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/docs/i18n-keymap.md b/docs/i18n-keymap.md index 9c5becf..43b7515 100644 --- a/docs/i18n-keymap.md +++ b/docs/i18n-keymap.md @@ -18,21 +18,21 @@ It maps existing text keys only (no feature expansion) and stays aligned with `s | 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 | `host` | `host.title` | Host gameplay flow | Vært gameplay-flow | +| Lobby | `player` | `player.title` | Player gameplay flow | Spiller gameplay-flow | | Lobby | `system` (`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 | +| Lobby | `player` | `player.nickname` | Nickname | Kaldenavn | +| Join | `player` | `player.join` | Join | Join | +| Start round | `host` | `host.start_round` | Start round | Start runde | +| Round | `host` | `host.show_question` | Show question | Vis spørgsmål | +| Round | `player` | `player.lie_label` | Lie | Løgn | +| Round | `player` | `player.submit_lie` | Submit lie | Send løgn | +| Round | `player` | `player.submit_guess` | Submit guess | Send gæt | +| Reveal | `host` | `host.mix_answers` | Mix answers → guess | Bland svar → gæt | +| Reveal | `host` | `host.calculate_scores` | Calculate scores → reveal | Udregn score → afslør | +| Scoreboard | `host` | `host.load_scoreboard` | Load scoreboard | Hent scoreboard | +| Scoreboard | `host` | `host.final_leaderboard` | Final leaderboard | Finale leaderboard | +| Scoreboard | `player` | `player.final_leaderboard` | Final leaderboard | Finale leaderboard | | Scoreboard | `system` (`frontend.ui.common`) | `common.points_short` | pts | point | ## Frontend error keys used in flow scope