feat(i18n): share lobby message catalog across frontend/backend
All checks were successful
CI / test-and-quality (pull_request) Successful in 2m8s
CI / test-and-quality (push) Successful in 2m15s

This commit is contained in:
2026-03-01 15:07:34 +00:00
committed by Asger Geel Weirsoee
parent a5c9e4f255
commit 3253f4d343
8 changed files with 166 additions and 26 deletions

View File

@@ -5,6 +5,7 @@ from django.shortcuts import render
from fupogfakta.models import Category
from .feature_flags import use_spa_ui
from .i18n import lobby_i18n_catalog
def _render_spa_shell(request, shell_route: str, shell_kind: str):
@@ -15,6 +16,7 @@ def _render_spa_shell(request, shell_route: str, shell_kind: str):
"shell_route": shell_route,
"shell_kind": shell_kind,
"spa_asset_base": settings.WPP_SPA_ASSET_BASE,
"lobby_i18n": lobby_i18n_catalog(),
},
)
@@ -30,11 +32,18 @@ def host_screen(request, spa_path=None):
return _render_spa_shell(request, host_route, "host")
categories = Category.objects.filter(is_active=True).order_by("name")
return render(request, "lobby/host_screen.html", {"categories": categories})
return render(
request,
"lobby/host_screen.html",
{
"categories": categories,
"lobby_i18n": lobby_i18n_catalog(),
},
)
def player_screen(request):
if use_spa_ui():
return _render_spa_shell(request, "/player", "player")
return render(request, "lobby/player_screen.html")
return render(request, "lobby/player_screen.html", {"lobby_i18n": lobby_i18n_catalog()})