feat: confirm before leaving a game, and fix untranslated strings
Exit confirmation - A dialog in the app's own style now guards every in-game screen. The safe action is the prominent one, so a stray tap keeps you in the game. - Eleven screens covered, against both the system back gesture and the close buttons. The message adapts: a single-device game is lost, a host ends it for everyone, a client can rejoin. - The two screens the host also opens from the manager take a flag so that back there just closes them instead of offering to quit. Translations - 21 keys were still holding the English text in Arabic, Basque, Hindi, Japanese, Korean, Dutch, Polish, Russian, Turkish and both Chinese variants: 231 strings, covering the whole multi-device flow, permissions and the mode picker. Nothing failed, the app just showed English. - The permissions dialog was hardcoded in Spanish; it is localized now. - Portuguese used Spanish gerunds where pt-PT takes "a + infinitive". Checked what looked untranslated but is not: Animals and Notes are correct Catalan, Configuration and Vibration correct French, Version correct German. Those are whitelisted in the new test rather than silently rewritten. l10n_cobertura_test guards all of it: no missing or orphan keys, no empty values, no English left outside the whitelist, and placeholders preserved.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import 'dart:async';
|
||||
import '../tema/dialogo_confirmacion.dart';
|
||||
import 'dart:math';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:farolero/l10n/generated/app_localizations.dart';
|
||||
@@ -257,7 +258,9 @@ class _PantallaGestorHostState extends State<PantallaGestorHost> {
|
||||
clientesPendientes.every((id) => _clientesListos[id] == true);
|
||||
final todosVotaron = estado.todosHanVotado();
|
||||
|
||||
return Scaffold(
|
||||
return GuardiaSalidaPartida(
|
||||
contexto: ContextoSalida.host,
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text(l10n.hostGame),
|
||||
automaticallyImplyLeading: false,
|
||||
@@ -299,8 +302,15 @@ class _PantallaGestorHostState extends State<PantallaGestorHost> {
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
tooltip: l10n.leaveGame,
|
||||
icon: IconoFarolero(Icons.close),
|
||||
onPressed: () async {
|
||||
if (!await confirmarSalirDePartida(
|
||||
context,
|
||||
ContextoSalida.host,
|
||||
)) {
|
||||
return;
|
||||
}
|
||||
await nearby.desconectar();
|
||||
widget.onPartidaFin();
|
||||
},
|
||||
@@ -340,6 +350,7 @@ class _PantallaGestorHostState extends State<PantallaGestorHost> {
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -580,6 +591,7 @@ class _PantallaGestorHostState extends State<PantallaGestorHost> {
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (_) => PantallaPalabrasCliente(
|
||||
protegerSalida: false,
|
||||
jugadores: jugadoresHost,
|
||||
pistaImpostor: partida.config.pistaImpostor
|
||||
? partida.pistaImpostor
|
||||
@@ -863,6 +875,7 @@ class _PantallaGestorHostState extends State<PantallaGestorHost> {
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (_) => PantallaVotacionCliente(
|
||||
protegerSalida: false,
|
||||
jugadores: partida.jugadoresActivos,
|
||||
jugadoresControlados: jugadoresHost,
|
||||
partidaId: context.read<ServicioNearby>().roomId,
|
||||
|
||||
Reference in New Issue
Block a user